Skip to content

Commit

Permalink
Add tests to catch colon in channel name regression.
Browse files Browse the repository at this point in the history
  • Loading branch information
tjni committed Nov 22, 2024
1 parent b014abd commit 17e8b80
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
13 changes: 11 additions & 2 deletions tests/test_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,13 @@ async def test_write_and_read_pending_writes_and_sends(self) -> None:

assert result.checkpoint["pending_sends"] == ["w3v"]

@pytest.mark.parametrize("channel_values", [{"channel1": "channel1v"}, {}])
@pytest.mark.parametrize(
"channel_values",
[
{"channel1": "channel1v"},
{}, # to catch regression reported in #10
],
)
async def test_write_and_read_channel_values(
self, channel_values: dict[str, Any]
) -> None:
Expand All @@ -155,7 +161,10 @@ async def test_write_and_read_channel_values(
chkpnt["id"] = "4"
chkpnt["channel_values"] = channel_values

newversions: ChannelVersions = {"channel1": 1}
newversions: ChannelVersions = {
"channel1": 1,
"channel:with:colon": 1, # to catch regression reported in #9
}
chkpnt["channel_versions"] = newversions

await saver.aput(config, chkpnt, {}, newversions)
Expand Down
13 changes: 11 additions & 2 deletions tests/test_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,13 @@ def test_write_and_read_pending_writes_and_sends(self) -> None:

assert result.checkpoint["pending_sends"] == ["w3v"]

@pytest.mark.parametrize("channel_values", [{"channel1": "channel1v"}, {}])
@pytest.mark.parametrize(
"channel_values",
[
{"channel1": "channel1v"},
{}, # to catch regression reported in #10
],
)
def test_write_and_read_channel_values(
self, channel_values: dict[str, Any]
) -> None:
Expand All @@ -154,7 +160,10 @@ def test_write_and_read_channel_values(
chkpnt["id"] = "4"
chkpnt["channel_values"] = channel_values

newversions: ChannelVersions = {"channel1": 1}
newversions: ChannelVersions = {
"channel1": 1,
"channel:with:colon": 1, # to catch regression reported in #9
}
chkpnt["channel_versions"] = newversions

saver.put(config, chkpnt, {}, newversions)
Expand Down

0 comments on commit 17e8b80

Please sign in to comment.