Skip to content

Commit

Permalink
ulwgl_test: update tests for Reaper
Browse files Browse the repository at this point in the history
  • Loading branch information
R1kaB3rN committed Feb 27, 2024
1 parent dd368d0 commit edec54e
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions ULWGL/ulwgl_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ def setUp(self):
"../../../ulwgl-run"
)

# Mock Reaper
Path(self.test_user_share, "reaper").touch()

# Mock the proton file in the dir
self.test_proton_dir.joinpath("proton").touch(exist_ok=True)

Expand Down Expand Up @@ -736,7 +739,7 @@ def test_copy_tree(self):
result = ulwgl_util.copyfile_tree(test_dir, self.test_local_share)

# Confirm the state of the dest dir
self.assertFalse(result, "Expected False after calling copyfile_tree")
self.assertTrue(result, "Expected False after calling copyfile_tree")
self.assertTrue(
any(self.test_local_share.iterdir()),
"Expected destination dir to not be empty",
Expand Down Expand Up @@ -1427,11 +1430,15 @@ def test_build_command(self):
test_command = ulwgl_run.build_command(self.env, test_command)
self.assertIsInstance(test_command, list, "Expected a List from build_command")
self.assertEqual(
len(test_command), 7, "Expected 7 elements in the list from build_command"
len(test_command), 10, "Expected 10 elements in the list from build_command"
)
# DEBUG [ulwgl_run.main:352]:['/home/celsius/.local/share/ULWGL/reaper', 'ULWGL_ID=0', '--', '/home/celsius/.local/share/ULWGL/ULWGL', '--verb', 'waitforexitandrun', '--', '/home/celsius/Proton/GE-Proton8-30/proton', 'waitforexitandrun', '/home/celsius/Games/aiyoku-no-eustia/Aiyoku no Eustia/BGI.exe']
# Verify contents
entry_point, opt1, verb, opt2, proton, verb2, exe = [*test_command]
reaper, id, opt0, entry_point, opt1, verb, opt2, proton, verb2, exe = [*test_command]

Check failure on line 1437 in ULWGL/ulwgl_test.py

View workflow job for this annotation

GitHub Actions / build (3.11)

Ruff (F841)

ULWGL/ulwgl_test.py:1437:21: F841 Local variable `opt0` is assigned to but never used

Check failure on line 1437 in ULWGL/ulwgl_test.py

View workflow job for this annotation

GitHub Actions / build (3.12)

Ruff (F841)

ULWGL/ulwgl_test.py:1437:21: F841 Local variable `opt0` is assigned to but never used
# The entry point dest could change. Just check if there's a value
self.assertTrue(reaper, "Expected reaper")
self.assertTrue(id, "Expected a tag for reaper")
self.assertTrue(id, "Expected --")
self.assertTrue(entry_point, "Expected an entry point")
self.assertEqual(opt1, "--verb", "Expected --verb")
self.assertEqual(verb, self.test_verb, "Expected a verb")
Expand Down

0 comments on commit edec54e

Please sign in to comment.