@@ -11,10 +11,10 @@ def test_util_get_root():
1111 x = {'p' : {'a' : {'t' : {'h' : 'value' }}}}
1212
1313 ret = dpath .util .get (x , '/p/a/t/h' )
14- assert ( ret == 'value' )
14+ assert ret == 'value'
1515
1616 ret = dpath .util .get (x , '/' )
17- assert ( ret == x )
17+ assert ret == x
1818
1919
2020def test_get_explicit_single ():
@@ -30,11 +30,11 @@ def test_get_explicit_single():
3030 },
3131 }
3232
33- assert ( dpath .util .get (ehash , '/a/b/c/f' ) == 2 )
34- assert ( dpath .util .get (ehash , ['a' , 'b' , 'c' , 'f' ]) == 2 )
35- assert ( dpath .util .get (ehash , ['a' , 'b' , 'c' , 'f' ], default = 5 ) == 2 )
36- assert ( dpath .util .get (ehash , ['does' , 'not' , 'exist' ], default = None ) is None )
37- assert ( dpath .util .get (ehash , ['doesnt' , 'exist' ], default = 5 ) == 5 )
33+ assert dpath .util .get (ehash , '/a/b/c/f' ) == 2
34+ assert dpath .util .get (ehash , ['a' , 'b' , 'c' , 'f' ]) == 2
35+ assert dpath .util .get (ehash , ['a' , 'b' , 'c' , 'f' ], default = 5 ) == 2
36+ assert dpath .util .get (ehash , ['does' , 'not' , 'exist' ], default = None ) is None
37+ assert dpath .util .get (ehash , ['doesnt' , 'exist' ], default = 5 ) == 5
3838
3939
4040def test_get_glob_single ():
@@ -50,10 +50,10 @@ def test_get_glob_single():
5050 },
5151 }
5252
53- assert ( dpath .util .get (ehash , '/a/b/*/f' ) == 2 )
54- assert ( dpath .util .get (ehash , ['a' , 'b' , '*' , 'f' ]) == 2 )
55- assert ( dpath .util .get (ehash , ['a' , 'b' , '*' , 'f' ], default = 5 ) == 2 )
56- assert ( dpath .util .get (ehash , ['doesnt' , '*' , 'exist' ], default = 6 ) == 6 )
53+ assert dpath .util .get (ehash , '/a/b/*/f' ) == 2
54+ assert dpath .util .get (ehash , ['a' , 'b' , '*' , 'f' ]) == 2
55+ assert dpath .util .get (ehash , ['a' , 'b' , '*' , 'f' ], default = 5 ) == 2
56+ assert dpath .util .get (ehash , ['doesnt' , '*' , 'exist' ], default = 6 ) == 6
5757
5858
5959def test_get_glob_multiple ():
@@ -96,16 +96,16 @@ def test_values():
9696 }
9797
9898 ret = dpath .util .values (ehash , '/a/b/c/*' )
99- assert ( isinstance (ret , list ) )
100- assert ( 0 in ret )
101- assert ( 1 in ret )
102- assert ( 2 in ret )
99+ assert isinstance (ret , list )
100+ assert 0 in ret
101+ assert 1 in ret
102+ assert 2 in ret
103103
104104 ret = dpath .util .values (ehash , ['a' , 'b' , 'c' , '*' ])
105- assert ( isinstance (ret , list ) )
106- assert ( 0 in ret )
107- assert ( 1 in ret )
108- assert ( 2 in ret )
105+ assert isinstance (ret , list )
106+ assert 0 in ret
107+ assert 1 in ret
108+ assert 2 in ret
109109
110110
111111@mock .patch ('dpath.util.search' )
@@ -126,7 +126,7 @@ def test_none_values():
126126 d = {'p' : {'a' : {'t' : {'h' : None }}}}
127127
128128 v = dpath .util .get (d , 'p/a/t/h' )
129- assert ( v is None )
129+ assert v is None
130130
131131
132132def test_values_list ():
@@ -142,8 +142,8 @@ def test_values_list():
142142 }
143143
144144 ret = dpath .util .values (a , 'actions/*' )
145- assert ( isinstance (ret , list ) )
146- assert ( len (ret ) == 2 )
145+ assert isinstance (ret , list )
146+ assert len (ret ) == 2
147147
148148
149149def test_non_leaf_leaf ():
0 commit comments