def test_create_volume_string_set_with_single_file(): dir_ = tempfile.mkdtemp() path = hlp.create_tmp_file("file_0", dir_) expected = "{}:{}:ro".format( dir_, vol.get_container_mount(path)['container_dir']) assert vol.create_volume_string_set([path]) == [expected]
def test_prepare_biobox_file(): config = biobox_cfg(hlp.short_read_fastq()) biobox_file = os.path.join( vol.get_host_path(exe.prepare_biobox_file(config)), "biobox.yaml") assert os.path.isfile(biobox_file) with open(biobox_file, 'r') as f: biobox_args = yaml.load(f.read())['arguments'] assert biobox_args == biobox_cfg( vol.get_container_mount(hlp.short_read_fastq())['biobox_target'])
def test_prepare_biobox_file(): config = biobox_cfg(hlp.short_read_fastq()) biobox_file = os.path.join( vol.get_host_path(exe.prepare_biobox_file(config)), "biobox.yaml") assert os.path.isfile(biobox_file) with open(biobox_file, 'r') as f: biobox_args = yaml.load(f.read())['arguments'] assert biobox_args == biobox_cfg(vol.get_container_mount(hlp.short_read_fastq())['biobox_target'])
def remap(x): f = lambda i: vol.get_container_mount(i)['biobox_target'] return funcy.update_in(x, ['value'], f)
def test_get_container_mount_with_single_dir(): path = hlp.create_tmp_dir("dir_1") volume = vol.get_container_mount(path) assert volume['host_dir'] == vol.host_directory(path) assert DIR_RE.search(volume['container_dir']) != None assert TARGET_RE.search(volume['biobox_target']) != None
def test_create_volume_string_set_with_single_file(): dir_ = tempfile.mkdtemp() path = hlp.create_tmp_file("file_0", dir_) expected = "{}:{}:ro".format(dir_, vol.get_container_mount(path)['container_dir']) assert vol.create_volume_string_set([path]) == [expected]
def test_remap_args_with_single_directory_entry(): host_dir = hlp.create_tmp_dir("dir_0") container_dir = vol.get_container_mount(host_dir)['biobox_target'] assert cnf.remap_biobox_input_paths(wrap("fasta_dir", [reference(host_dir)])) == \ wrap("fasta_dir", [reference(container_dir)])
def test_remap_args_with_single_file_entry(): host_file = hlp.create_tmp_file("file_0") container_file = vol.get_container_mount(host_file)['biobox_target'] assert cnf.remap_biobox_input_paths(wrap("fastq", [fastq(host_file)])) == \ wrap("fastq", [fastq(container_file)])