Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# 1 - test_npz
# 2 - test_npz_incorrect_region
# 3 - test_npz_incorrect_datatype
# 4 - test_hdf5
# 5 - test_hdf5_incorrect_region
# 6 - test_hdf5_incorrect_datatype
# 7 - test_npz_incorrect_channel
# 8 - test_hdf5_incorrect_channel
p = Params()
p.token = 'unittest'
p.resolution = 0
p.channels = ['CHAN1', 'CHAN2']
p.window = [0,500]
p.channel_type = IMAGE
p.datatype = FLOAT32
#p.args = (3000,3100,4000,4100,500,510)
class Test_Probability_Slice:
def setup_class(self):
makeunitdb.createTestDB(p.token, channel_list=p.channels, channel_type=p.channel_type, channel_datatype=p.datatype)
def teardown_class(self):
makeunitdb.deleteTestDB(p.token)
def test_xy (self):
"""Test the xy slice cutout"""
import makeunitdb
from ndlib.ndtype import IMAGE, UINT8, UINT16
from params import Params
from postmethods import postNPZ, getNPZ, getHDF5, postHDF5, getURL, postBlosc, getBlosc
from test_settings import *
# Test_Blosc
# 1 - test_get_blosc
# 2 - test_post_blosc
p = Params()
p.token = 'unittest'
p.resolution = 0
p.channels = ['IMAGE1', 'IMAGE2']
p.window = [0,500]
p.channel_type = IMAGE
p.datatype = UINT8
p.voxel = [4.0,4.0,3.0]
class Test_Blosc:
def setup_class(self):
makeunitdb.createTestDB(p.token, channel_list=p.channels, channel_type=p.channel_type, channel_datatype=p.datatype)
def teardown_class(self):
makeunitdb.deleteTestDB(p.token)
def test_get_blosc (self):
"""Test the xy slice cutout"""
import numpy as np
import makeunitdb
from ndlib.ndtype import IMAGE, UINT8, UINT16
from params import Params
from postmethods import postNPZ, getRAW
from test_settings import *
# Test_RAW
# 1 - test_get_raw
p = Params()
p.token = 'unittest'
p.resolution = 0
p.channels = ['IMAGE1', 'IMAGE2']
p.window = [0,500]
p.channel_type = IMAGE
p.datatype = UINT8
p.voxel = [4.0,4.0,3.0]
class Test_Raw:
def setup_class(self):
makeunitdb.createTestDB(p.token, channel_list=p.channels, channel_type=p.channel_type, channel_datatype=p.datatype)
def teardown_class(self):
makeunitdb.deleteTestDB(p.token)
def test_get_raw (self):
"""Test the xyz cube cutout"""
# 1 - test_npz
# 2 - test_npz_incorrect_region
# 3 - test_npz_incorrect_datatype
# 4 - test_hdf5
# 5 - test_hdf5_incorrect_region
# 6 - test_hdf5_incorrect_datatype
# 7 - test_npz_incorrect_channel
# 8 - test_hdf5_incorrect_channel
p = Params()
p.token = 'unittest'
p.resolution = 0
p.channels = ['IMAGE1', 'IMAGE2']
p.window = [0,500]
p.channel_type = IMAGE
p.datatype = UINT8
p.voxel = [4.0,4.0,3.0]
#p.args = (3000,3100,4000,4100,500,510)
class Test_Image_Slice:
def setup_class(self):
"""Setup class parameters"""
makeunitdb.createTestDB(p.token, channel_list=p.channels, channel_type=p.channel_type, channel_datatype=p.datatype)
def teardown_class(self):
"""Cleanup class parameters"""
makeunitdb.deleteTestDB(p.token)
def test_xy (self):
import cStringIO
import makeunitdb
from ndlib.ndtype import IMAGE, UINT8, UINT16
from params import Params
from postmethods import postNPZ, getNPZ, getHDF5, postHDF5, getURL, postBlosc, getBlosc
from test_settings import *
# Test_Jpeg
# 1 - test_get_jpeg
p = Params()
p.token = 'unittest'
p.resolution = 0
p.channels = ['IMAGE1', 'IMAGE2']
p.window = [0,500]
p.channel_type = IMAGE
p.datatype = UINT8
p.voxel = [4.0,4.0,3.0]
#p.args = (3000,3100,4000,4100,500,510)
class Test_Jpeg:
def setup_class(self):
makeunitdb.createTestDB(p.token, channel_list=p.channels, channel_type=p.channel_type, channel_datatype=p.datatype)
def teardown_class(self):
makeunitdb.deleteTestDB(p.token)
def test_get_jpeg (self):
import ND.settings
os.environ['DJANGO_SETTINGS_MODULE'] = 'ND.settings'
from ingest.core.config import Configuration
from ndlib.ndtype import IMAGE, UINT8, MYSQL
from params import Params
from postmethods import getJSON, postJSON, deleteJSON, postURL
import makeunitdb
import site_to_test
SITE_HOST = site_to_test.site
p = Params()
p.token = 'unittest'
p.project = 'unittest'
p.resolution = 0
p.channels = ['CHAN1', 'CHAN2']
p.channel_type = IMAGE
p.datatype = UINT8
p.dataset = 'unittest'
class Test_AutoIngest():
def setup_class(self):
"""Setup Parameters"""
makeunitdb.createTestDB(p.project, channel_list=p.channels, ximagesize=2000, yimagesize=2000, zimagesize=1000, xvoxelres=1.0, yvoxelres=1.0, zvoxelres=5.0, token_name=p.token)
def teardown_class(self):
"""Teardown Parameters"""
makeunitdb.deleteTestDB(p.project, token_name=p.token)
def test_post_config(self):
import makeunitdb
sys.path += [os.path.abspath('../django')]
import ND.settings
os.environ['DJANGO_SETTINGS_MODULE'] = 'ND.settings'
from ingest.core.config import Configuration
from ndlib.ndtype import IMAGE, UINT8, MYSQL
from params import Params
from ndlib.restutil import getJson, postJson, deleteJson, postURL
from test_settings import *
p = Params()
p.token = 'unittest'
p.project = 'unittest'
p.resolution = 0
p.channels = ['CHAN1', 'CHAN2']
p.channel_type = IMAGE
p.datatype = UINT8
p.dataset = 'unittest'
@pytest.mark.skipif(True, reason='Test not necessary for dev mode')
class Test_AutoIngest():
def setup_class(self):
"""Setup Parameters"""
makeunitdb.createTestDB(p.project, channel_list=p.channels, ximagesize=2000, yimagesize=2000, zimagesize=1000, xvoxelres=1.0, yvoxelres=1.0, zvoxelres=5.0, token_name=p.token)
self.job_id = 0
def teardown_class(self):
"""Teardown Parameters"""
makeunitdb.deleteTestDB(p.project, token_name=p.token)