more tests and asserts

This commit is contained in:
Roberto Alsina 2020-02-05 19:17:02 -03:00
parent 6bb15ea6d3
commit 08ce2032ab
2 changed files with 18 additions and 0 deletions

View File

@ -22,6 +22,7 @@ def test_parse_modes(test_data):
assert len(m.modes) == 9
assert m.enabled
assert m.primary
assert m.orientation == "normal"
def test_disabled_monitor(test_data):
@ -29,3 +30,10 @@ def test_disabled_monitor(test_data):
m = Monitor(data)
assert m.enabled is False
assert m.primary is False
def test_parse_orientation(test_data):
data = test_data.read("monitor_1.txt", deserialize=False).splitlines()
data[0] = data[0].replace("normal (", "left (")
m = Monitor(data)
assert m.orientation == "left"

View File

@ -19,3 +19,13 @@ def test_replicated_monitors(test_data):
screen = parse_data(data)
assert screen.monitors["eDP"].replica_of == ["HDMI-A-0"]
assert screen.choose_a_monitor() == "eDP"
def test_get_set_primary(test_data):
data = test_data.read("sample_1.txt", deserialize=False).splitlines()
screen = parse_data(data)
assert screen.get_primary().output == "eDP"
screen.set_primary("HDMI-A-0")
assert screen.get_primary().output == "HDMI-A-0"
screen.set_primary("FOOBAR")
assert screen.get_primary() is None