def setUpClass(cls):
"""Do an initial DB clean up in case something went wrong the last time.
If a test failed really badly, the DB might be in a bad state despite
attempts to clean up during tearDown().
"""
cls.rmt = BossRemote('test.cfg', API_VER)
# Turn off SSL cert verification. This is necessary for interacting with
# developer instances of the Boss.
cls.rmt.project_service.session_send_opts = {'verify': False}
cls.rmt.metadata_service.session_send_opts = {'verify': False}
cls.rmt.volume_service.session_send_opts = {'verify': False}
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
coll_name = 'collection_perm_test-{}'.format(random.randint(0, 9999))
cls.coll = CollectionResource(coll_name, 'bar')
cf_name = 'PermissionTestFrame{}'.format(random.randint(0, 9999))
cls.coord = CoordinateFrameResource(
cf_name, 'Test coordinate frame.', 0, 10, -5, 5, 3, 6,
1, 1, 1, 'nanometers', 0, 'nanoseconds')
cls.exp = ExperimentResource(
'perm_test_exp', cls.coll.name, cls.coord.name, 'my experiment', 1,
'isotropic', 1)
cls.chan = ChannelResource(
'perm_test_ch', cls.coll.name, cls.exp.name, 'image', 'test channel',
0, 'uint8', 0)
cls.grp_name = 'int_perm_test_group{}'.format(random.randint(0, 9999))
cls.rmt.create_project(cls.coll)
cls.rmt.create_project(cls.coord)
cls.rmt.create_project(cls.exp)
cls.rmt.create_project(cls.chan)
cls.rmt.create_group(cls.grp_name)
评论列表
文章目录