From 8ee08999c35ed9a3a476527d3dff02244535cb6e Mon Sep 17 00:00:00 2001 From: R1kaB3rN <100738684+R1kaB3rN@users.noreply.github.com> Date: Tue, 24 Sep 2024 17:15:41 -0700 Subject: [PATCH] umu_test: add test when passed a sequence that should not be rearranged --- umu/umu_test.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/umu/umu_test.py b/umu/umu_test.py index f39401e00..4d5a4cfeb 100644 --- a/umu/umu_test.py +++ b/umu/umu_test.py @@ -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 = [] @@ -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]],