@@ -222,22 +222,20 @@ def test_convert_nongraph_json():
222222)
223223def test_convert_outer_key_not_string ():
224224 result = convert_graph_data (
225- {
226- 0 : {
227- '0' : json .dumps ({"foo" : 1 , "bar" : 2 }),
228- }
229- })
225+ {
226+ 0 : {
227+ "0" : json .dumps ({"foo" : 1 , "bar" : 2 }),
228+ }
229+ }
230+ )
230231 assert result == {"error" : "Expected outer key to be str, got <class 'int'>" }
231232
232233
233234@pytest .mark .skipif (
234235 graph_visualization is None , reason = "Requires `spanner-graph-notebook`"
235236)
236237def test_convert_outer_value_not_dict ():
237- result = convert_graph_data (
238- {
239- 'result' : 0
240- })
238+ result = convert_graph_data ({"result" : 0 })
241239 assert result == {"error" : "Expected outer value to be dict, got <class 'int'>" }
242240
243241
@@ -246,11 +244,12 @@ def test_convert_outer_value_not_dict():
246244)
247245def test_convert_inner_key_not_string ():
248246 result = convert_graph_data (
249- {
250- 'result' : {
251- 0 : json .dumps ({"foo" : 1 , "bar" : 2 }),
252- }
253- })
247+ {
248+ "result" : {
249+ 0 : json .dumps ({"foo" : 1 , "bar" : 2 }),
250+ }
251+ }
252+ )
254253 assert result == {"error" : "Expected inner key to be str, got <class 'int'>" }
255254
256255
@@ -259,11 +258,12 @@ def test_convert_inner_key_not_string():
259258)
260259def test_convert_inner_value_not_string ():
261260 result = convert_graph_data (
262- {
263- 'result' : {
264- '0' : 1 ,
265- }
266- })
261+ {
262+ "result" : {
263+ "0" : 1 ,
264+ }
265+ }
266+ )
267267 assert result == {"error" : "Expected inner value to be str, got <class 'int'>" }
268268
269269
@@ -278,19 +278,22 @@ def test_convert_one_column_one_row_two_columns():
278278 },
279279 "result2" : {
280280 "0" : json .dumps (row_alex_owns_account ),
281- }
282-
281+ },
283282 }
284283 )
285- assert result == {"error" : "Query has multiple columns - graph visualization not supported" }
284+ assert result == {
285+ "error" : "Query has multiple columns - graph visualization not supported"
286+ }
286287
287288
288289@pytest .mark .skipif (
289290 graph_visualization is None , reason = "Requires `spanner-graph-notebook`"
290291)
291292def test_convert_empty_dict ():
292293 result = convert_graph_data ({})
293- assert result == {"error" : "query result with no columns is not supported for graph visualization" }
294+ assert result == {
295+ "error" : "query result with no columns is not supported for graph visualization"
296+ }
294297
295298
296299class TestGraphServer (unittest .TestCase ):
0 commit comments