From 7d4f4df2e5bc063946077c95d5936ba51f0ee231 Mon Sep 17 00:00:00 2001 From: kedhammar Date: Tue, 9 Apr 2024 17:25:33 +0200 Subject: [PATCH] wip, perform demux and increase test cov by 5% --- taca/illumina/Standard_Runs.py | 2 +- tests/analysis/test_analysis.py | 7 ++++++- tests/conftest.py | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/taca/illumina/Standard_Runs.py b/taca/illumina/Standard_Runs.py index 08d6fdbc..ae49eaa2 100755 --- a/taca/illumina/Standard_Runs.py +++ b/taca/illumina/Standard_Runs.py @@ -429,7 +429,7 @@ def demultiplex_run(self): f"started for run {os.path.basename(self.id)} on {datetime.now()}" ) - # Demutiplexing done for one mask type and scripts will continue + # Demultiplexing done for one mask type and scripts will continue # Working with the next type. Command counter should increase by 1 bcl_cmd_counter += 1 return True diff --git a/tests/analysis/test_analysis.py b/tests/analysis/test_analysis.py index c372e4f6..745402c6 100644 --- a/tests/analysis/test_analysis.py +++ b/tests/analysis/test_analysis.py @@ -392,7 +392,7 @@ def create_illumina_run_dir( if os.path.exists(run_path): shutil.rmtree(run_path) os.makedirs(run_path) - os.makedirs(os.path.join(run_path, "Demultiplexing")) + # os.makedirs(os.path.join(run_path, "Demultiplexing")) TODO # Set up files if completed: @@ -562,3 +562,8 @@ def test_get_runObj(create_dirs): software = "bcl2fastq" _run_obj = analysis.get_runObj(run_path, software) + + _mock_upload_to_db = patch("taca.analysis.analysis._upload_to_statusdb").start() + with patch("subprocess.Popen") as mock_Popen: + mock_Popen.start() + analysis.run_preprocessing(run_path, software) diff --git a/tests/conftest.py b/tests/conftest.py index 620bba93..2e7d02d5 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -17,6 +17,7 @@ def create_dirs(): │ ├── transfer_minion_qc.tsv │ ├── transfer_minion.tsv │ └── transfer_promethion.tsv + │ └── transfer.tsv ├── miarka │ ├── minion │ │ └── qc @@ -85,6 +86,7 @@ def create_dirs(): open(f"{tmp.name}/log/transfer_promethion.tsv", "w").close() open(f"{tmp.name}/log/transfer_minion.tsv", "w").close() open(f"{tmp.name}/log/transfer_minion_qc.tsv", "w").close() + open(f"{tmp.name}/log/transfer.tsv", "w").close() # Analysis server destination dirs os.makedirs(f"{tmp.name}/miarka/promethion")