Example #1
0
def config_tempdir(tmpdir, template_db):
    os.environ['OT_API_CONFIG_DIR'] = str(tmpdir)
    config.reload()
    if not os.path.exists(config.CONFIG['labware_database_file']):
        shutil.copyfile(
            template_db, config.CONFIG['labware_database_file'])
    yield tmpdir, template_db
Example #2
0
def config_tempdir(tmpdir):
    os.environ['OT_API_CONFIG_DIR'] = str(tmpdir)
    config.reload()
    old_db_path = database.database_path
    shutil.copyfile(database.database_path,
                    config.CONFIG['labware_database_file'])
    database.change_database(str(config.CONFIG['labware_database_file']))
    yield tmpdir, old_db_path
Example #3
0
def ot_config_tempdir(tmpdir):
    os.environ['OT_API_CONFIG_DIR'] = str(tmpdir)
    config.reload()

    yield tmpdir

    del os.environ['OT_API_CONFIG_DIR']
    config.reload()
Example #4
0
def labware_offset_tempdir(tmpdir):
    os.environ['OT_API_CONFIG_DIR'] = str(tmpdir)
    config.reload()

    yield config.get_opentrons_path('labware_calibration_offsets_dir_v2')

    del os.environ['OT_API_CONFIG_DIR']
    config.reload()
Example #5
0
def server_temp_directory():
    new_dir = tempfile.mkdtemp()
    os.environ['OT_API_CONFIG_DIR'] = new_dir
    config.reload()

    yield new_dir
    shutil.rmtree(new_dir)

    del os.environ['OT_API_CONFIG_DIR']
Example #6
0
def offsets_tempdir(tmpdir, template_db):
    config.CONFIG['labware_calibration_offsets_dir_v2'] = str(tmpdir)
    config.reload()
    yield tmpdir
Example #7
0
def index_file_dir(tmpdir):
    config.CONFIG['labware_calibration_offsets_dir_v2'] = tmpdir
    # config.reload()
    yield tmpdir
    config.reload()