Skip to content

Commit

Permalink
ulwgl_test: update tests to mock setting up the runtime on update
Browse files Browse the repository at this point in the history
- The runtime files have been removed from the repo and will no longer be stored in the root directory along with the launcher files. Therefore, an error will be raised when attempting to locate the runtime directory from the configuration file
  • Loading branch information
R1kaB3rN committed Feb 28, 2024
1 parent 60e095e commit 050ce82
Showing 1 changed file with 54 additions and 14 deletions.
68 changes: 54 additions & 14 deletions ULWGL/ulwgl_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,33 @@ def test_update_ulwgl_empty(self):
)

# Update
result = ulwgl_util._update_ulwgl(
self.test_user_share,
self.test_local_share,
self.test_compat,
json_root,
json_local,
)
with patch.object(
ulwgl_util,
"setup_runtime",
return_value=None,
):
result = ulwgl_util._update_ulwgl(
self.test_user_share,
self.test_local_share,
self.test_compat,
json_root,
json_local,
)
ulwgl_util.copyfile_tree(
Path(self.test_user_share, "sniper_platform_0.20240125.75305"),
Path(self.test_local_share, "sniper_platform_0.20240125.75305"),
)
ulwgl_util.copyfile_reflink(
Path(self.test_user_share, "run"), Path(self.test_local_share, "run")
)
ulwgl_util.copyfile_reflink(
Path(self.test_user_share, "run-in-sniper"),
Path(self.test_local_share, "run-in-sniper"),
)
ulwgl_util.copyfile_reflink(
Path(self.test_user_share, "ULWGL"),
Path(self.test_local_share, "ULWGL"),
)

self.assertFalse(result, "Expected None when calling _update_ulwgl")

Expand Down Expand Up @@ -434,13 +454,33 @@ def test_update_ulwgl(self):
filer.write("foo")

# Update
result = ulwgl_util._update_ulwgl(
self.test_user_share,
self.test_local_share,
self.test_compat,
json_root,
json_local,
)
with patch.object(
ulwgl_util,
"setup_runtime",
return_value=None,
):
result = ulwgl_util._update_ulwgl(
self.test_user_share,
self.test_local_share,
self.test_compat,
json_root,
json_local,
)
ulwgl_util.copyfile_tree(
Path(self.test_user_share, "sniper_platform_0.20240125.75305"),
Path(self.test_local_share, "sniper_platform_0.20240125.75305"),
)
ulwgl_util.copyfile_reflink(
Path(self.test_user_share, "run"), Path(self.test_local_share, "run")
)
ulwgl_util.copyfile_reflink(
Path(self.test_user_share, "run-in-sniper"),
Path(self.test_local_share, "run-in-sniper"),
)
ulwgl_util.copyfile_reflink(
Path(self.test_user_share, "ULWGL"),
Path(self.test_local_share, "ULWGL"),
)

self.assertFalse(result, "Expected None when calling _update_ulwgl")

Expand Down

0 comments on commit 050ce82

Please sign in to comment.