Mercurial > repos > rhpvorderman > shm_csr
comparison tests/test_shm_csr.py @ 3:dced6d52d218 draft
"planemo upload commit bdfa4424496371fbea3edd3de07d8be9d0bad432"
| author | rhpvorderman |
|---|---|
| date | Mon, 15 Nov 2021 11:35:18 +0000 |
| parents | 64d74ba01a7c |
| children | 495a521cf9f2 |
comparison
equal
deleted
inserted
replaced
| 2:72d68e2e1fd3 | 3:dced6d52d218 |
|---|---|
| 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 temp_dir = tempfile.mktemp() | 39 temp_dir = Path(tempfile.mkdtemp()) |
| 40 shutil.copytree(GIT_ROOT, temp_dir) | 40 tool_dir = temp_dir / "shm_csr" |
| 41 shutil.copytree(GIT_ROOT, tool_dir) | |
| 42 working_dir = temp_dir / "working" | |
| 43 working_dir.mkdir(parents=True) | |
| 44 output_dir = temp_dir / "outputs" | |
| 45 output_dir.mkdir(parents=True) | |
| 46 wrapper = str(tool_dir / "wrapper.sh") | |
| 41 input = str(CONTROL_NWK377_PB_IGHC_MID1_40nt_2) | 47 input = str(CONTROL_NWK377_PB_IGHC_MID1_40nt_2) |
| 42 out_files_path = os.path.join(temp_dir, "results") | 48 out_files_path = output_dir / "results" |
| 43 out_file = os.path.join(out_files_path, "result.html") | 49 out_file = out_files_path / "result.html" |
| 44 infile_name = "input_data" | 50 infile_name = "input_data" |
| 45 functionality = "productive" | 51 functionality = "productive" |
| 46 unique = "Sequence.ID" | 52 unique = "Sequence.ID" |
| 47 naive_output = "no" | 53 naive_output = "no" |
| 48 naive_output_ca = "None" | 54 naive_output_ca = "None" |
| 55 class_filter = '70_70' | 61 class_filter = '70_70' |
| 56 empty_region_filter = 'FR1' | 62 empty_region_filter = 'FR1' |
| 57 fast = 'no' | 63 fast = 'no' |
| 58 cmd = [ | 64 cmd = [ |
| 59 "bash", | 65 "bash", |
| 60 "wrapper.sh", | 66 wrapper, |
| 61 input, | 67 input, |
| 62 "custom", | 68 "custom", |
| 63 out_file, | 69 str(out_file), |
| 64 out_files_path, | 70 str(out_files_path), |
| 65 infile_name, | 71 infile_name, |
| 66 "-", | 72 "-", |
| 67 functionality, | 73 functionality, |
| 68 unique, | 74 unique, |
| 69 naive_output, | 75 naive_output, |
| 76 filter_unique_count, | 82 filter_unique_count, |
| 77 class_filter, | 83 class_filter, |
| 78 empty_region_filter, | 84 empty_region_filter, |
| 79 fast | 85 fast |
| 80 ] | 86 ] |
| 81 subprocess.run(cmd, cwd=temp_dir, stdout=sys.stdout, stderr=sys.stderr, | 87 with open(temp_dir / "stderr", "wt") as stderr_file: |
| 82 check=True) | 88 with open(temp_dir / "stdout", "wt") as stdout_file: |
| 89 subprocess.run(cmd, cwd=working_dir, stdout=stdout_file, | |
| 90 stderr=stderr_file, check=True) | |
| 83 yield Path(out_files_path) | 91 yield Path(out_files_path) |
| 84 #shutil.rmtree(temp_dir) | 92 #shutil.rmtree(temp_dir) |
| 85 | 93 |
| 86 | 94 |
| 87 def test_check_output(shm_csr_result): | 95 def test_check_output(shm_csr_result): |
