Skip to content

Commit

Permalink
Updated testing
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBurchLog committed Dec 5, 2023
1 parent 1e15385 commit a656163
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion brewtils/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ def client(self, new_client):
client_clazz._bg_version = self._system.version
client_clazz._bg_commands = self._system.commands
client_clazz._current_request = client_clazz.current_request
client_clazz._tags = client_clazz._system.tags
client_clazz._tags = self._system.tags
except TypeError:
if sys.version_info.major != 2:
raise
Expand Down
2 changes: 1 addition & 1 deletion brewtils/test/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def system_dict(instance_dict, command_dict, command_dict_2, system_id):
"metadata": {"some": "stuff"},
"namespace": "ns",
"local": True,
"tags": [],
"tags": ["foo"],
"template": "<html>template</html>",
}

Expand Down
5 changes: 5 additions & 0 deletions test/plugin_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,11 +453,13 @@ def test_system_exists(
instances=[bg_instance],
commands=current_commands,
metadata={"foo": "bar"},
tags=["foo"],
template=None,
)
ez_client.find_unique_system.return_value = existing_system

bg_system.commands = [Command("test")]
bg_system.tags=["foo"]
ez_client.update_system.return_value = bg_system

plugin._initialize_system()
Expand All @@ -469,6 +471,7 @@ def test_system_exists(
description=bg_system.description,
icon_name=bg_system.icon_name,
display_name=bg_system.display_name,
tags=["foo"],
template="<html>template</html>",
)
# assert ez_client.create_system.return_value == plugin.system
Expand All @@ -481,6 +484,7 @@ def test_new_instance(self, plugin, ez_client, bg_system, bg_instance):
instances=[bg_instance],
max_instances=2,
metadata={"foo": "bar"},
tags=["foo"],
template=None,
)
ez_client.find_unique_system.return_value = existing_system
Expand All @@ -498,6 +502,7 @@ def test_new_instance(self, plugin, ez_client, bg_system, bg_instance):
icon_name=bg_system.icon_name,
display_name=bg_system.display_name,
template="<html>template</html>",
tags=bg_system.tags,
add_instance=ANY,
)
assert ez_client.update_system.call_args[1]["add_instance"].name == new_name
Expand Down

0 comments on commit a656163

Please sign in to comment.