Mercurial > repos > rhpvorderman > shm_csr
comparison tests/test_shm_csr.py @ 5:495a521cf9f2 draft
"planemo upload commit 40d62ec3d2fea3c3bac605c976941e1f3b7e2cd4"
| author | rhpvorderman |
|---|---|
| date | Tue, 16 Nov 2021 11:16:06 +0000 |
| parents | dced6d52d218 |
| children | ea9d5fc4c001 |
comparison
equal
deleted
inserted
replaced
| 4:c8f02bce10d0 | 5:495a521cf9f2 |
|---|---|
| 34 CONTROL_NWK377_PB_IGHC_MID1_40nt_2 = TEST_DATA_DIR / "CONTROL_NWK377_PB_IGHC_MID1_40nt_2.txz" | 34 CONTROL_NWK377_PB_IGHC_MID1_40nt_2 = TEST_DATA_DIR / "CONTROL_NWK377_PB_IGHC_MID1_40nt_2.txz" |
| 35 | 35 |
| 36 | 36 |
| 37 @pytest.fixture(scope="module") | 37 @pytest.fixture(scope="module") |
| 38 def shm_csr_result(): | 38 def shm_csr_result(): |
| 39 docker_container = "quay.io/rhpvorderman/mulled-v2-f7d31c9d7424063a492fc0e5ecbf89bc757c0107:2b50bdd4d8c1fefc6ec24b0753fad0dcecec843b-0" | |
| 39 temp_dir = Path(tempfile.mkdtemp()) | 40 temp_dir = Path(tempfile.mkdtemp()) |
| 40 tool_dir = temp_dir / "shm_csr" | 41 tool_dir = temp_dir / "shm_csr" |
| 41 shutil.copytree(GIT_ROOT, tool_dir) | 42 shutil.copytree(GIT_ROOT, tool_dir) |
| 42 working_dir = temp_dir / "working" | 43 working_dir = temp_dir / "working" |
| 43 working_dir.mkdir(parents=True) | 44 working_dir.mkdir(parents=True) |
| 82 filter_unique_count, | 83 filter_unique_count, |
| 83 class_filter, | 84 class_filter, |
| 84 empty_region_filter, | 85 empty_region_filter, |
| 85 fast | 86 fast |
| 86 ] | 87 ] |
| 88 docker_cmd = ["docker", "run", "-v", f"{temp_dir}:{temp_dir}", | |
| 89 "-v", f"{input}:{input}", | |
| 90 "-w", str(working_dir), | |
| 91 docker_container] + cmd | |
| 87 with open(temp_dir / "stderr", "wt") as stderr_file: | 92 with open(temp_dir / "stderr", "wt") as stderr_file: |
| 88 with open(temp_dir / "stdout", "wt") as stdout_file: | 93 with open(temp_dir / "stdout", "wt") as stdout_file: |
| 89 subprocess.run(cmd, cwd=working_dir, stdout=stdout_file, | 94 subprocess.run(docker_cmd, cwd=working_dir, stdout=stdout_file, |
| 90 stderr=stderr_file, check=True) | 95 stderr=stderr_file, check=True) |
| 91 yield Path(out_files_path) | 96 yield Path(out_files_path) |
| 92 #shutil.rmtree(temp_dir) | 97 #shutil.rmtree(temp_dir) |
| 93 | 98 |
| 94 | 99 |
