@@ -33,24 +33,21 @@ def test_can_hydrate_v1_node_structure():
3333
3434 with pytest .warns (DeprecationWarning , match = "element_id" ):
3535 assert alice .id == 123
36- # for backwards compatibility, the driver should compy the element_id
36+ # for backwards compatibility, the driver should compute the element_id
3737 assert alice .element_id == "123"
3838 assert alice .labels == {"Person" }
3939 assert set (alice .keys ()) == {"name" }
4040 assert alice .get ("name" ) == "Alice"
4141
4242
43- @pytest .mark .parametrize ("with_id" , (True , False ))
44- def test_can_hydrate_v2_node_structure (with_id ):
43+ def test_can_hydrate_v2_node_structure ():
4544 hydrant = DataHydrator ()
4645
47- id_ = 123 if with_id else None
48-
49- struct = Structure (b'N' , id_ , ["Person" ], {"name" : "Alice" }, "abc" )
46+ struct = Structure (b'N' , 123 , ["Person" ], {"name" : "Alice" }, "abc" )
5047 alice , = hydrant .hydrate ([struct ])
5148
5249 with pytest .warns (DeprecationWarning , match = "element_id" ):
53- assert alice .id == id_
50+ assert alice .id == 123
5451 assert alice .element_id == "abc"
5552 assert alice .labels == {"Person" }
5653 assert set (alice .keys ()) == {"name" }
@@ -78,25 +75,20 @@ def test_can_hydrate_v1_relationship_structure():
7875 assert rel .get ("since" ) == 1999
7976
8077
81- @pytest .mark .parametrize ("with_ids" , (True , False ))
82- def test_can_hydrate_v2_relationship_structure (with_ids ):
78+ def test_can_hydrate_v2_relationship_structure ():
8379 hydrant = DataHydrator ()
8480
85- id_ = 123 if with_ids else None
86- start_id = 456 if with_ids else None
87- end_id = 789 if with_ids else None
88-
89- struct = Structure (b'R' , id_ , start_id , end_id , "KNOWS" , {"since" : 1999 },
81+ struct = Structure (b'R' , 123 , 456 , 789 , "KNOWS" , {"since" : 1999 },
9082 "abc" , "def" , "ghi" )
9183
9284 rel , = hydrant .hydrate ([struct ])
9385
9486 with pytest .warns (DeprecationWarning , match = "element_id" ):
95- assert rel .id == id_
87+ assert rel .id == 123
9688 with pytest .warns (DeprecationWarning , match = "element_id" ):
97- assert rel .start_node .id == start_id
89+ assert rel .start_node .id == 456
9890 with pytest .warns (DeprecationWarning , match = "element_id" ):
99- assert rel .end_node .id == end_id
91+ assert rel .end_node .id == 789
10092 # for backwards compatibility, the driver should compy the element_id
10193 assert rel .element_id == "abc"
10294 assert rel .start_node .element_id == "def"
@@ -125,7 +117,8 @@ def test_can_hydrate_in_list():
125117
126118 alice , = alice_in_list
127119
128- assert alice .id == 123
120+ with pytest .warns (DeprecationWarning , match = "element_id" ):
121+ assert alice .id == 123
129122 assert alice .labels == {"Person" }
130123 assert set (alice .keys ()) == {"name" }
131124 assert alice .get ("name" ) == "Alice"
@@ -141,7 +134,8 @@ def test_can_hydrate_in_dict():
141134
142135 alice = alice_in_dict ["foo" ]
143136
144- assert alice .id == 123
137+ with pytest .warns (DeprecationWarning , match = "element_id" ):
138+ assert alice .id == 123
145139 assert alice .labels == {"Person" }
146140 assert set (alice .keys ()) == {"name" }
147141 assert alice .get ("name" ) == "Alice"
0 commit comments