Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
aramoto99 committed May 8, 2024
1 parent 16ca715 commit 7a059f7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 deletions.
19 changes: 15 additions & 4 deletions tests/job/test_abci_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def setUp(self) -> None:
stderr_filename=self.stderr_filename,
qsub_args=self.qsub_args,
args=self.args,
tag=self.tag
tag=self.tag,
)

def tearDown(self) -> None:
Expand All @@ -59,9 +59,20 @@ def test_init(self) -> None:
self.assertEqual(
self.job.cmd,
[
"qsub", "-g", self.job_group, "-o", str(self.stdout_filename), "-e", str(self.stderr_filename),
"-N", self.job_name, "-l", str(self.job_filename), "arg1", "arg2"
]
"qsub",
"-g",
self.job_group,
"-o",
str(self.stdout_filename),
"-e",
str(self.stderr_filename),
"-N",
self.job_name,
"-l",
str(self.job_filename),
"arg1",
"arg2",
],
)

def test_submit(self) -> None:
Expand Down
12 changes: 5 additions & 7 deletions tests/job/test_abci_job_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def setUp(self) -> None:
self.job_group,
job_name=self.job_name,
work_dir=self.work_dir,
n_max_jobs=self.n_max_jobs
n_max_jobs=self.n_max_jobs,
)

def tearDown(self) -> None:
Expand Down Expand Up @@ -65,9 +65,8 @@ def test_available_slots_full(self) -> None:
with patch("subprocess.run", return_value=qstat_xml("tests/job/qstat_dat.txt")):
result = self.executor.available_slots()

num_available_slots = (
self.n_max_jobs
- len([j for j in self.executor.job_list if j.status == JobStatus.RUNNING or JobStatus.WAITING])
num_available_slots = self.n_max_jobs - len(
[j for j in self.executor.job_list if j.status == JobStatus.RUNNING or JobStatus.WAITING]
)
self.assertEqual(result, num_available_slots)

Expand Down Expand Up @@ -96,9 +95,8 @@ def test_available_slots_pending(self) -> None:
with patch("subprocess.run", return_value=qstat_xml("tests/job/qstat_dat 2r_1qw.txt")):
result = self.executor.available_slots()

num_available_slots = (
self.n_max_jobs
- len([j for j in self.executor.job_list if j.status == JobStatus.RUNNING or JobStatus.WAITING])
num_available_slots = self.n_max_jobs - len(
[j for j in self.executor.job_list if j.status == JobStatus.RUNNING or JobStatus.WAITING]
)
self.assertEqual(result, num_available_slots)

Expand Down

0 comments on commit 7a059f7

Please sign in to comment.