Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_get_project_error(self):
response = getJson('https://{}/resource/dataset/{}/project/{}/'.format(SITE_HOST, p.dataset, 'foo'))
assert(response.status_code == 404)
def test_list_project(self):
response = getJson('https://{}/resource/dataset/{}/project/'.format(SITE_HOST, p.dataset))
assert(p.project in response.json())
def test_get_token(self):
response = getJson('https://{}/resource/dataset/{}/project/{}/token/{}/'.format(SITE_HOST, p.dataset, p.project, 'foo'))
assert(response.status_code == 404)
def test_public_dataset(self):
response = getJson('https://{}/resource/public/dataset/'.format(SITE_HOST))
assert(p.dataset in response.json())
def test_get_dataset_error(self):
response = getJson('https://{}/resource/dataset/{}/'.format(SITE_HOST, 'foo'))
assert(response.status_code == 404)
def test_get_dataset(self):
response = getJson('https://{}/resource/dataset/{}/'.format(SITE_HOST, p.dataset))
assert(response.status_code == 200)
assert(response.json()['dataset_name'] == p.dataset)
assert(response.json()['ximagesize'] == 2000)
assert(response.json()['xvoxelres'] == 1.0)
def test_get_channel_error(self):
response = getJson('https://{}/resource/dataset/{}/project/{}/channel/{}/'.format(SITE_HOST, p.dataset, p.project, 'foo'))
assert(response.status_code == 404)
def test_get_channel(self):
response = getJson('https://{}/resource/dataset/{}/project/{}/channel/{}/'.format(SITE_HOST, p.dataset, p.project, p.channels[0]))
assert(response.status_code == 200)
assert(response.json()['channel_name'] == p.channels[0])
assert(response.json()['channel_type'] == p.channel_type)
assert(response.json()['channel_datatype'] == p.datatype)
assert(response.json()['startwindow'] == 0)
assert(response.json()['endwindow'] == 500)
def test_list_dataset(self):
response = getJson('https://{}/resource/dataset/'.format(SITE_HOST))
assert(p.dataset in response.json())
def test_get_token(self):
response = getJson('https://{}/resource/dataset/{}/project/{}/token/{}/'.format(SITE_HOST, p.dataset, p.project, p.token))
assert(response.status_code == 200)
assert(response.json()['token_name'] == p.token)