Skip to content

Commit 638e6fb

Browse files
committed
More descriptive assert on TEST_INFO_TAG
1 parent c95028c commit 638e6fb

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

server/tests/test_bash_ioc.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,17 +92,19 @@ def test_remove_infotag(self, setup_compose: DockerCompose) -> None:
9292
channels = cf_client.find(name=DEFAULT_CHANNEL_NAME)
9393
TEST_INFO_TAG = {"name": "archive", "owner": "admin", "value": "testing", "channels": []}
9494

95-
assert len(channels) == test_channel_count
96-
assert TEST_INFO_TAG in channels[0]["properties"]
95+
assert any(TEST_INFO_TAG in ch["properties"] for ch in channels), (
96+
"Info tag 'archive' not found in channel before removal"
97+
)
9798

9899
# Act
99100
restart_ioc(docker_ioc, cf_client, DEFAULT_CHANNEL_NAME, "test_remove_infotag_after.db")
100101

101102
# Assert
102103
channels = cf_client.find(name=DEFAULT_CHANNEL_NAME)
103104
LOG.debug("archive channels: %s", channels)
104-
assert len(channels) == test_channel_count
105-
assert TEST_INFO_TAG not in channels[0]["properties"]
105+
assert all(TEST_INFO_TAG not in ch["properties"] for ch in channels), (
106+
"Info tag 'archive' still found in channel after removal"
107+
)
106108

107109

108110
class TestRemoveChannel:

0 commit comments

Comments
 (0)