mirror of
https://github.com/ralsina/xrandroll.git
synced 2024-12-17 22:30:17 +00:00
more tests and asserts
This commit is contained in:
parent
6bb15ea6d3
commit
08ce2032ab
@ -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"
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user