Skip to content

Commit

Permalink
Fixed bug in test
Browse files Browse the repository at this point in the history
  • Loading branch information
pvandyken committed Sep 21, 2021
1 parent e58bb35 commit fbcbb7d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/test_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def test_batch_submits_testmode(capsys: CaptureFixture[str]):

out = capsys.readouterr()
assert "--account=ctb-akhanf --time=03:00:00 --cpus-per-task=1 --mem=4000" in str(out)
subprocess.assert_called_once_with("echo '#!/bin/bash\ncommand' | cat", shell=True, capture_output=True)
subprocess.assert_called_once_with("echo '#!/bin/bash\ncommand' | cat", shell=True, stdout=-1, stderr=-2)

def test_params_can_be_altered(capsys: CaptureFixture[str]):
with mock.patch('subprocess.run') as subprocess:
Expand All @@ -34,5 +34,5 @@ def test_params_can_be_altered(capsys: CaptureFixture[str]):
subprocess.assert_called_once_with(
"echo '#!/bin/bash\ncommand' | sbatch --account=some-account "
"--time=2-09:11:00 --cpus-per-task=8 --mem=5000 --gres=gpu:1 "
"--job-name=command --parsable ", shell=True, capture_output=True)
"--job-name=command --parsable ", shell=True, stdout=-1, stderr=-2)
assert Path.cwd() == starting_cwd / 'test'

0 comments on commit fbcbb7d

Please sign in to comment.