Skip to content

Commit

Permalink
adjut for tests
Browse files Browse the repository at this point in the history
Signed-off-by: Sylvain Hellegouarch <sh@defuze.org>
  • Loading branch information
Lawouach committed Dec 10, 2023
1 parent b3c929b commit c9376b7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions chaosaws/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,9 @@ def convert_tags(tags: Union[str, Dict[str, str]]) -> Dict[str, str]:
"""
Convert a `k=v,x=y` string into a dictionary
"""
if tags is None:
return {}

if isinstance(tags, dict):
return tags

Expand Down
10 changes: 9 additions & 1 deletion tests/fis/test_fis_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,15 @@ def test_that_stop_experiment_by_tags(aws_client):
client = MagicMock()
aws_client.return_value = client

resp = {"experiments": [{"id": "an-id", "tags": {"test-tag": "a-value"}}]}
resp = {
"experiments": [
{
"id": "an-id",
"tags": {"test-tag": "a-value"},
"state": {"status": "running"},
}
]
}
client.list_experiments.return_value = resp

stop_experiments_by_tags(tags={"test-tag": "a-value"})
Expand Down

0 comments on commit c9376b7

Please sign in to comment.