Skip to content

Commit

Permalink
Tidy up the tests a little bit
Browse files Browse the repository at this point in the history
  • Loading branch information
tbooth committed Dec 10, 2024
1 parent 5868ce9 commit af6c5d8
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions test/test_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import sys, os, re
from unittest.mock import patch

import subprocess
from subprocess import check_call
from tempfile import mkdtemp
from shutil import rmtree, copytree
from glob import glob
Expand Down Expand Up @@ -32,8 +32,7 @@ def test_new_upstream(self):
self.bm_rundriver()

if self.verbose:
subprocess.call(["tree", "-usa", self.temp_dir])
subprocess.call(["head", "-v", f"{self.temp_dir}/runs/{run_name}/pipeline/type.yaml"])
check_call(["head", "-v", f"{self.temp_dir}/runs/{run_name}/pipeline/type.yaml"])

# The run is named '20190226_TEST_00testrun'. Check for dirs and symlinks.
self.assertTrue(os.path.isdir(f"{self.temp_dir}/runs/{run_name}/pipeline"))
Expand Down Expand Up @@ -78,7 +77,7 @@ def test_new_upstream_withbatch(self):
self.bm_rundriver()

if self.verbose:
subprocess.call(["tree", "-usa", self.temp_dir])
check_call(["tree", "-usa", self.temp_dir])

# The run is named '20190226_TEST_00testrun'. Check for dirs and symlinks.
self.assertTrue(os.path.isdir(f"{self.temp_dir}/runs/2019-02/{run_name}/pipeline"))
Expand All @@ -97,7 +96,7 @@ def test_new_upstream2(self):
self.bm_rundriver()

if self.verbose:
subprocess.call(["tree", "-usa", self.temp_dir])
check_call(["tree", "-usa", self.temp_dir])

self.assertTrue(os.path.isdir(f"{self.temp_dir}/runs/20000101_TEST_00testrun2/pipeline"))

Expand All @@ -116,7 +115,7 @@ def test_new_upstream2_withbatch(self):
self.bm_rundriver()

if self.verbose:
subprocess.call(["tree", "-usa", self.temp_dir])
check_call(["tree", "-usa", self.temp_dir])

self.assertTrue(os.path.isdir(f"{self.temp_dir}/runs/2000/20000101_TEST_00testrun2/pipeline"))

Expand All @@ -140,7 +139,7 @@ def test_new_without_upstream(self):
self.bm_rundriver()

if self.verbose:
subprocess.call(["tree", "-usa", self.temp_dir])
check_call(["tree", "-usa", self.temp_dir])

# Check for dirs and symlinks as above
self.assertTrue(os.path.isdir(f"{self.temp_dir}/runs/{run_name}/pipeline"))
Expand Down Expand Up @@ -196,7 +195,7 @@ def test_new_but_output_exists(self):
self.assertInStdout("cannot create directory")

if self.verbose:
subprocess.call(["tree", "-usa", self.temp_dir])
check_call(["tree", "-usa", self.temp_dir])

# The failed flag should be set
self.assertTrue(os.path.exists(f"{self.temp_dir}/runs/20190710_LOCALTEST_00newrun/pipeline/failed"))
Expand Down Expand Up @@ -249,7 +248,7 @@ def test_log_bug(self):
self.bm_rundriver()

if self.verbose:
subprocess.call(["tree", "-usa", self.temp_dir])
check_call(["tree", "-usa", self.temp_dir])

# The run will be named '20190226_TEST_00testrun'. Check for dirs and symlinks.
log1 = slurp_file(f"{self.temp_dir}/fastqdata/20190226_TEST_00testrun/pipeline.log")
Expand Down

0 comments on commit af6c5d8

Please sign in to comment.