Skip to content
This repository was archived by the owner on Apr 4, 2024. It is now read-only.

Commit d00d33b

Browse files
committed
tests for LiteralBoolean
1 parent 4e73dd7 commit d00d33b

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
def _encode(value: bool, expected: str):
2+
actual = "true" if value else "false"
3+
assert actual == expected, f"Expected: {expected}, Got: {actual}"
4+
5+
6+
def _decode(value: str, expected: bool):
7+
actual = value.lower() == "true"
8+
assert actual == expected, f"Expected: {expected}, Got: {actual}"
9+
10+
11+
class TestLiteralBoolean:
12+
def test_encode(self):
13+
_encode(True, "true")
14+
_encode(False, "false")
15+
16+
def test_decode(self):
17+
_decode("true", True)
18+
_decode("false", False)

0 commit comments

Comments
 (0)