Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def createTestDB ( project_name, channel_list=['unit_anno'], channel_type=ANNOTATION, channel_datatype=UINT32, public=PUBLIC_TRUE, ximagesize=10000, yimagesize=10000, zimagesize=1000, xvoxelres=4.0, yvoxelres=4.0, zvoxelres=3.0, scalingoption=ZSLICES, scalinglevels=5, readonly=READONLY_FALSE, propagate=NOT_PROPAGATED, window=[0,0], time=[0,0], default=False, nd_version=ND_VERSION, token_name='unittest', user='neurodata', dataset_name="unittest" ):
"""Create a unit test data base on the specified sit and name"""
unituser = User.objects.get(username=user)
ds = NDDataset(Dataset ( dataset_name=dataset_name, user=unituser, ximagesize=ximagesize, yimagesize=yimagesize, zimagesize=zimagesize, xoffset=0, yoffset=0, zoffset=1, xvoxelres=xvoxelres, yvoxelres=yvoxelres, zvoxelres=zvoxelres, scalingoption=scalingoption, scalinglevels=scalinglevels, public=PUBLIC_TRUE, dataset_description="Unit test" ) )
ds.create()
# make the project entry
pr = NDProject(Project(project_name=project_name, project_description='Unit test', user=unituser, dataset=ds._ds, nd_version=nd_version, host='localhost', kvengine=KV_ENGINE, kvserver=KV_SERVER, s3backend=0))
pr.create()
# create a token
tk = NDToken(Token (token_name = token_name, user = unituser, token_description = 'Unit test token', project_id = pr.project_name, public = public))
tk.create()
# get the correct object for the kvengine
def setup_class(self):
"""Setup Parameters"""
makeunitdb.createTestDB(p.token, p.channels, channel_type=ANNOTATION, channel_datatype=UINT32, public=True, ximagesize=1024, yimagesize=1024, zimagesize=10, xvoxelres=1.0, yvoxelres=1.0, zvoxelres=10.0, readonly=0)
import numpy as np
import pytest
from contextlib import closing
import networkx as nx
import makeunitdb
from ndlib.ndtype import ANNOTATION, UINT32
from params import Params
from ramonmethods import H5AnnotationFile, setField, getField, queryField, makeAnno, createSpecificSynapse
from postmethods import putAnnotation, getAnnotation, getURL, postURL
from test_settings import *
p = Params()
p.token = 'unittest'
p.resolution = 0
p.channels = ['ANNO1']
p.channel_type = ANNOTATION
p.datatype = UINT32
@pytest.mark.skipif(True, reason='Test not necessary for dev mode')
class Test_GraphGen:
def setup_class(self):
"""Create the unittest database"""
makeunitdb.createTestDB(p.token, channel_list=p.channels, public=True, readonly=0, ximagesize=100, yimagesize=100, zimagesize=100)
cutout1 = "0/2,5/1,3/1,3"
cutout2 = "0/1,3/4,6/2,5"
cutout3 = "0/4,6/2,5/5,7"
cutout4 = "0/6,8/5,9/2,4"
syn_segments1 = [7, 3]
syn_segments2 = [7, 4]