def test_create_volume_string_set_with_two_files_in_same_dir(): dir_ = tempfile.mkdtemp() files = [ hlp.create_tmp_file("file_0", dir_), hlp.create_tmp_file("file_1", dir_) ] assert len(list(vol.create_volume_string_set(files))) == 1
def test_get_biobox_paths_with_two_files(): path_0 = hlp.create_tmp_file("file_0") path_1 = hlp.create_tmp_file("file_1") biobox = [{"fastq": [ {"id": 0, "type": "paired", "value": path_0}, {"id": 0, "type": "paired", "value": path_1} ] }] assert cnf.get_all_biobox_paths(biobox) == [path_0, path_1]
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_get_biobox_paths_with_single_file(): path = hlp.create_tmp_file("file_0") biobox = [{"fastq": [ {"id": 0, "type": "paired", "value": path} ] }] assert cnf.get_all_biobox_paths(biobox) == [path]
def test_create_volume_string_set_with_two_files_in_different_dir(): files = [hlp.create_tmp_file("file_0"), hlp.create_tmp_file("file_1")] assert len(list(vol.create_volume_string_set(files))) == 2
def test_get_container_mount_with_single_file(): path = hlp.create_tmp_file("file_0") 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_two_files_in_same_dir(): dir_ = tempfile.mkdtemp() files = [hlp.create_tmp_file("file_0", dir_), hlp.create_tmp_file("file_1", dir_)] assert len(list(vol.create_volume_string_set(files))) == 1
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_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)])