@@ -37,9 +37,9 @@ def setUp(self):
37
37
38
38
def test_metadata_query (self ):
39
39
with open (METADATA_QUERY_SUCCESS , 'rb' ) as f :
40
- response_json = f . read ( )
40
+ response_json = json . load ( f )
41
41
with requests_mock .mock () as m :
42
- m .post (self .baseurl , content = response_json )
42
+ m .post (self .baseurl , json = response_json )
43
43
actual = self .server .metadata .query ('fake query' )
44
44
45
45
datasources = actual ['data' ]
@@ -48,9 +48,9 @@ def test_metadata_query(self):
48
48
49
49
def test_metadata_query_ignore_error (self ):
50
50
with open (METADATA_QUERY_ERROR , 'rb' ) as f :
51
- response_json = f . read ( )
51
+ response_json = json . load ( f )
52
52
with requests_mock .mock () as m :
53
- m .post (self .baseurl , content = response_json )
53
+ m .post (self .baseurl , json = response_json )
54
54
actual = self .server .metadata .query ('fake query' )
55
55
datasources = actual ['data' ]
56
56
@@ -60,9 +60,9 @@ def test_metadata_query_ignore_error(self):
60
60
61
61
def test_metadata_query_abort_on_error (self ):
62
62
with open (METADATA_QUERY_ERROR , 'rb' ) as f :
63
- response_json = f . read ( )
63
+ response_json = json . load ( f )
64
64
with requests_mock .mock () as m :
65
- m .post (self .baseurl , content = response_json )
65
+ m .post (self .baseurl , json = response_json )
66
66
67
67
with self .assertRaises (GraphQLError ) as e :
68
68
self .server .metadata .query ('fake query' , abort_on_error = True )
0 commit comments