Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickOHara committed Oct 11, 2021
1 parent c831515 commit 8a2d4e7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tests/fields/test_edge_data_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def field():
@pytest.mark.parametrize('text,value,exc', [
('1 2\n2 3\n-1', [(1, 2), (2, 3)], None),
('1 2\n2 x\n-1', [(1, 2), (2, 3)], E.ParsingError),
('1 2 3\n2 3\n-1', {1: [2, 3], 2: [3]}, None),
('1 2 3 -1\n2 3 -1\n-1', {1: [2, 3], 2: [3]}, None),
('1 x 3\n2 3\n-1', {1: [2, 3], 2: [3]}, E.ParsingError),
])
def test_parse(field, text, value, exc):
Expand Down
2 changes: 1 addition & 1 deletion tests/fields/test_edge_list_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def edge_list_field():


def test_parse(edge_list_field):
assert edge_list_field.parse('1 2\n3 4\n-1') == [[1, 2], [3, 4]]
assert edge_list_field.parse('1 2\n3 4\n-1') == [(1, 2), (3, 4)]


def test_render(edge_list_field):
Expand Down
4 changes: 2 additions & 2 deletions tsplib95/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,8 @@ class AdjacencyListField(TransformerField):
@classmethod
def build_transformer(cls):
return T.MapT(key=T.FuncT(func=int),
value=T.ListT(value=T.FuncT(func=int)),
sep="\n",
value=T.ListT(value=T.FuncT(func=int), terminal='-1'),
sep='\n',
terminal='-1')


Expand Down

0 comments on commit 8a2d4e7

Please sign in to comment.