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_post_project(self):
project = {
'project_name' : p.project,
'host' : 'localhost',
's3backend' : 0,
'public' : 1,
'kvserver' : 'localhost',
'kvengine' : MYSQL
}
response = postJson('https://{}/resource/dataset/{}/project/{}'.format(SITE_HOST, p.dataset, p.project), project)
assert(response.status_code == 201)
def test_post_channel(self):
channel = {
'channel_name' : p.channels[0],
'channel_type' : p.channel_type,
'channel_datatype' : p.datatype,
'startwindow' : 0,
'endwindow': 500
}
response = postJson('https://{}/resource/dataset/{}/project/{}/channel/{}/'.format(SITE_HOST, p.dataset, p.project, p.channels[0]), channel)
assert(response.status_code == 201)
def test_post_token(self):
token = {
'token_name' : p.token,
'public' : 1
}
response = postJson('https://{}/resource/dataset/{}/project/{}/token/{}/'.format(SITE_HOST, p.dataset, p.project, p.token), token)
assert(response.status_code == 201)
def test_post_dataset(self):
dataset = {
'dataset_name' : p.dataset,
'ximagesize': 2000,
'yimagesize' : 2000,
'zimagesize' : 100,
'xvoxelres' : 1.0,
'yvoxelres' : 2.0,
'zvoxelres' : 1.0,
'public' : 1
}
response = postJson('https://{}/resource/dataset/{}/'.format(SITE_HOST, p.dataset), dataset)
assert(response.status_code == 201)
def create_channel(dataset_name, project_name, channel_name, channel_type, channel_datatype, startwindow, endwindow):
channel = {
'channel_name' : channel_name,
'channel_type' : channel_type,
'channel_datatype' : channel_datatype,
'startwindow' : startwindow,
'endwindow' : endwindow
}
response = postJson('http://{}/resource/dataset/{}/project/{}/channel/{}/'.format(SITE_HOST, dataset_name, project_name, channel_name), channel)
assert(response.status_code == 201)