api: fixes and changes to always return content type in API
- few tweeks here and there
This commit is contained in:
parent
745c3af99f
commit
047254866b
6 changed files with 67 additions and 58 deletions
|
|
@ -63,7 +63,7 @@ class TestApi(object):
|
|||
|
||||
def test_api_missing_non_optional_param_args_null(self):
|
||||
id_, params = build_data(self.apikey, 'get_repo')
|
||||
params = params.replace('"args": {}', '"args": null')
|
||||
params = params.replace(b'"args": {}', b'"args": null')
|
||||
response = api_call(self.app, params)
|
||||
|
||||
expected = 'Missing non optional `repoid` arg in JSON DATA'
|
||||
|
|
@ -71,7 +71,7 @@ class TestApi(object):
|
|||
|
||||
def test_api_missing_non_optional_param_args_bad(self):
|
||||
id_, params = build_data(self.apikey, 'get_repo')
|
||||
params = params.replace('"args": {}', '"args": 1')
|
||||
params = params.replace(b'"args": {}', b'"args": 1')
|
||||
response = api_call(self.app, params)
|
||||
|
||||
expected = 'Missing non optional `repoid` arg in JSON DATA'
|
||||
|
|
@ -111,13 +111,13 @@ class TestApi(object):
|
|||
|
||||
def test_api_args_is_null(self):
|
||||
__, params = build_data(self.apikey, 'get_users', )
|
||||
params = params.replace('"args": {}', '"args": null')
|
||||
params = params.replace(b'"args": {}', b'"args": null')
|
||||
response = api_call(self.app, params)
|
||||
assert response.status == '200 OK'
|
||||
|
||||
def test_api_args_is_bad(self):
|
||||
__, params = build_data(self.apikey, 'get_users', )
|
||||
params = params.replace('"args": {}', '"args": 1')
|
||||
params = params.replace(b'"args": {}', b'"args": 1')
|
||||
response = api_call(self.app, params)
|
||||
assert response.status == '200 OK'
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue