From 67f9974a55bab2ad0743c1cc6f913f2941f071b8 Mon Sep 17 00:00:00 2001 From: martin bendsoe Date: Tue, 24 Mar 2020 10:24:41 +0100 Subject: [PATCH] fixed test --- neo4j/graph/__init__.py | 2 +- tests/unit/test_types.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/neo4j/graph/__init__.py b/neo4j/graph/__init__.py index 2f898ca32..e6d43731d 100644 --- a/neo4j/graph/__init__.py +++ b/neo4j/graph/__init__.py @@ -221,7 +221,7 @@ def __init__(self, graph, n_id, n_labels=None, properties=None): self._labels = frozenset(n_labels or ()) def __repr__(self): - return "" % (self._id, self._labels, self._properties) + return "" % (self._id, "', '".join(sorted(self._labels)), {key: val for key, val in sorted(self._properties.items())}) @property def labels(self): diff --git a/tests/unit/test_types.py b/tests/unit/test_types.py index 697fceb69..957b10296 100644 --- a/tests/unit/test_types.py +++ b/tests/unit/test_types.py @@ -45,7 +45,7 @@ def test_can_create_node(): assert set(alice.items()) == {("name", "Alice"), ("age", 33)} assert alice.get("name") == "Alice" assert alice.get("age") == 33 - assert repr(alice) == "" + assert repr(alice) == "" assert len(alice) == 2 assert alice["name"] == "Alice" assert alice["age"] == 33 @@ -103,7 +103,7 @@ def test_can_create_relationship(): assert set(alice_knows_bob.values()) == {1999} assert set(alice_knows_bob.items()) == {("since", 1999)} assert alice_knows_bob.get("since") == 1999 - assert repr(alice_knows_bob) == ", ) type='KNOWS' properties={'since': 1999}>" + assert repr(alice_knows_bob) == ", ) type='KNOWS' properties={'since': 1999}>" # Path @@ -123,7 +123,7 @@ def test_can_create_path(): assert path.nodes == (alice, bob, carol) assert path.relationships == (alice_knows_bob, carol_dislikes_bob) assert list(path) == [alice_knows_bob, carol_dislikes_bob] - assert repr(path) == " end= size=2>" + assert repr(path) == " end= size=2>" def test_can_hydrate_path(): @@ -142,7 +142,7 @@ def test_can_hydrate_path(): expected_carol_dislikes_bob = gh.hydrate_relationship(2, carol.id, bob.id, "DISLIKES", {}) assert path.relationships == (expected_alice_knows_bob, expected_carol_dislikes_bob) assert list(path) == [expected_alice_knows_bob, expected_carol_dislikes_bob] - assert repr(path) == " end= size=2>" + assert repr(path) == " end= size=2>" def test_path_equality():