Skip to content

Commit

Permalink
umu_test: add test when passed a sequence that should not be rearranged
Browse files Browse the repository at this point in the history
  • Loading branch information
R1kaB3rN committed Sep 25, 2024
1 parent 8f1068b commit a02ffea
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion umu/umu_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,20 @@ def tearDown(self):
if self.test_usr.exists():
rmtree(self.test_usr.as_posix())

def test_rearrange_gamescope_baselayer_none(self):
"""Test rearrange_gamescope_baselayer_order when passed correct seq.
A rearranged sequence should only be returned when the last element
is 769. Otherwise, None should be returned
"""
baselayer = [1, 2, 3, 769]
result = umu_run.rearrange_gamescope_baselayer_order(baselayer)

self.assertTrue(
result is None,
f"Expected None to be returned for sequence {baselayer}",
)

def test_rearrange_gamescope_baselayer_order_err(self):
"""Test rearrange_gamescope_baselayer_order for unexpected seq."""
baselayer = []
Expand All @@ -195,7 +209,7 @@ def test_rearrange_gamescope_baselayer_order_err(self):
umu_run.rearrange_gamescope_baselayer_order(baselayer)

def test_rearrange_gamescope_baselayer_order(self):
"""Test rearrange_gamescope_baselayer_order for expected sequences."""
"""Test rearrange_gamescope_baselayer_order when passed a sequence."""
baselayer = [1, 2, 3, 4]
expected = (
[baselayer[0], baselayer[-1], *baselayer[1:-1]],
Expand Down

0 comments on commit a02ffea

Please sign in to comment.