Skip to content

Commit 88c5c61

Browse files
elyashivcmccandless
authored andcommitted
sgf-parsing: update tests to 1.2.0 (exercism#1615)
* added not equal implementation * added a test for multiple properties * fixed linting errors * update version
1 parent 313d1d1 commit 88c5c61

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

exercises/sgf-parsing/sgf_parsing.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ def __eq__(self, other):
2121
return False
2222
return True
2323

24+
def __ne__(self, other):
25+
return not self == other
26+
2427

2528
def parse(input_string):
2629
pass

exercises/sgf-parsing/sgf_parsing_test.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from sgf_parsing import parse, SgfTree
44

55

6-
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.0.0
6+
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.2.0
77

88
class SgfParsingTest(unittest.TestCase):
99
def test_empty_input(self):
@@ -81,6 +81,14 @@ def test_escaped_property(self):
8181
)
8282
self.assertEqual(parse(input_string), expected)
8383

84+
def test_multiple_properties(self):
85+
input_string = '(;A[b]C[d])'
86+
expected = SgfTree(
87+
properties={'A': ['b'],
88+
'C': ['d']}
89+
)
90+
self.assertEqual(parse(input_string), expected)
91+
8492
# Utility functions
8593
def setUp(self):
8694
try:

0 commit comments

Comments
 (0)