Skip to content

Commit fab8096

Browse files
ricaskewclaude
andcommitted
test(toml): address PR #566 Copilot review feedback
- Add `-> None` return annotation to all new test methods to match the convention in other tests/serializers/ files. - Escape `\033` as `\\033` in the test_encode_ansi_control_character docstring so the docstring renders as printable text. No behavior change; pure consistency polish. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent fcdd66d commit fab8096

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

tests/serializers/test_toml_serializer.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ class toml_serializer_test_case(unittest.TestCase):
1414
that handles them correctly and guard against regression.
1515
"""
1616

17-
def test_encode_ansi_control_character(self):
17+
def test_encode_ansi_control_character(self) -> None:
1818
"""Scenario 1 — falsification clause #1.
1919
20-
`benedict({"color": "\033[31m"}).to_toml()` must not raise. On
20+
`benedict({"color": "\\033[31m"}).to_toml()` must not raise. On
2121
baseline (uiri/toml) this raises IndexError in the encoder.
2222
"""
2323
payload = {"color": "\033[31m"}
@@ -28,7 +28,7 @@ def test_encode_ansi_control_character(self):
2828
decoded = IODict.from_toml(encoded)
2929
self.assertEqual(decoded["color"], "\033[31m")
3030

31-
def test_encode_issue_439_literal_examples(self):
31+
def test_encode_issue_439_literal_examples(self) -> None:
3232
"""Scenario 2 — regression guard for issue #439's cited examples.
3333
3434
These pass on baseline (literal backslashes, not control chars).
@@ -44,7 +44,7 @@ def test_encode_issue_439_literal_examples(self):
4444
self.assertEqual(decoded["reset"], "\\033\\[00;00m")
4545
self.assertEqual(decoded["lightblue"], "\\033\\[01;30m")
4646

47-
def test_roundtrip_control_chars_and_unicode(self):
47+
def test_roundtrip_control_chars_and_unicode(self) -> None:
4848
"""Scenario 4 — round-trip integrity across tricky values."""
4949
payload = {
5050
"ansi_red": "\033[31m",
@@ -60,7 +60,7 @@ def test_roundtrip_control_chars_and_unicode(self):
6060
for key, value in payload.items():
6161
self.assertEqual(decoded[key], value, f"round-trip mismatch for {key!r}")
6262

63-
def test_encode_nested_dict(self):
63+
def test_encode_nested_dict(self) -> None:
6464
"""Structural coverage — nested dicts still encode correctly."""
6565
payload = {
6666
"section": {
@@ -73,7 +73,7 @@ def test_encode_nested_dict(self):
7373
self.assertEqual(decoded["section"]["key"], "value")
7474
self.assertEqual(decoded["section"]["control"], "\033[31m")
7575

76-
def test_serializer_decode_roundtrip(self):
76+
def test_serializer_decode_roundtrip(self) -> None:
7777
"""Direct serializer-level round-trip (bypasses IODict convenience layer)."""
7878
serializer = TOMLSerializer()
7979
payload = {"color": "\033[31m", "count": 42}

0 commit comments

Comments
 (0)