Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests to catch colon in channel name regression. #14

Merged
merged 1 commit into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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