Skip to content

Commit

Permalink
Add test for sorting .esl and .esm plugins
Browse files Browse the repository at this point in the history
Add a test that verifies the sort command puts .esl and .esm plugins
before .esp plugins.
  • Loading branch information
cyberrumor committed Mar 25, 2024
1 parent 4a8c08a commit 9930db3
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
Binary file added test/Downloads/esl.7z
Binary file not shown.
Binary file added test/Downloads/esm.7z
Binary file not shown.
24 changes: 24 additions & 0 deletions test/test_controller_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,3 +518,27 @@ def test_no_delete_all_if_plugin_active():
with pytest.raises(Warning) as warning:
controller.delete(DeleteEnum.PLUGIN, "all")
assert warning.value.args == (expected,)


def test_sort_esm_esl():
"""
Test that .esl and .esm plugins are auto-sorted to
before .esp plugins from the 'sort' command.
"""
with AmmoController() as controller:
install_mod(controller, "normal_mod")
install_mod(controller, "esm")
install_mod(controller, "esl")
install_mod(controller, "conflict_1")

assert controller.plugins[0].name == "normal_plugin.esp"
assert controller.plugins[1].name == "plugin.esm"
assert controller.plugins[2].name == "plugin.esl"
assert controller.plugins[3].name == "mock_plugin.esp"

controller.sort()

assert controller.plugins[0].name == "plugin.esm"
assert controller.plugins[1].name == "plugin.esl"
assert controller.plugins[2].name == "normal_plugin.esp"
assert controller.plugins[3].name == "mock_plugin.esp"

0 comments on commit 9930db3

Please sign in to comment.