Skip to content

Commit

Permalink
add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-janssen committed Feb 29, 2024
1 parent 0b27ebd commit a7b624c
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions tests/test_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,47 @@ def test_command_slurm(self):
),
)
self.assertEqual(result_dict, parse_arguments(command_lst))

def test_command_slurm_user_command(self):
result_dict = {
"host": "127.0.0.1",
"zmqport": "22",
}
command_lst = [
"srun",
"-n",
"2",
"-D",
os.path.abspath("."),
"--gpus-per-task=1",
"--oversubscribe",
"--account=test",
"--job-name=pympipool",
sys.executable,
"/",
"--host",
result_dict["host"],
"--zmqport",
result_dict["zmqport"],
]
interface = SrunInterface(
cwd=os.path.abspath("."),
cores=2,
gpus_per_core=1,
oversubscribe=True,
command_line_argument_lst=["--account=test", "--job-name=pympipool"],
)
self.assertEqual(
command_lst,
interface.generate_command(
command_lst=[
sys.executable,
"/",
"--host",
result_dict["host"],
"--zmqport",
result_dict["zmqport"],
]
),
)
self.assertEqual(result_dict, parse_arguments(command_lst))

0 comments on commit a7b624c

Please sign in to comment.