Skip to content

Commit

Permalink
fix some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-eq committed Dec 17, 2024
1 parent 51cd724 commit f3e2112
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/ert/unit_tests/scheduler/test_openpbs_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def parse_resource_string(qsub_args: str) -> dict[str, str]:
async def test_realization_memory():
driver = OpenPBSDriver()
await driver.submit(0, "sleep", realization_memory=1024**2)
assert " -l mem=1gb" in Path("captured_qsub_args").read_text(encoding="utf-8")
assert " -l mem=1mb" in Path("captured_qsub_args").read_text(encoding="utf-8")


@pytest.mark.usefixtures("capturing_qsub")
Expand All @@ -151,11 +151,11 @@ async def test_no_default_realization_memory():


@pytest.mark.usefixtures("capturing_qsub")
async def test_no_validation_of_realization_memory():
async def test_realization_memory_not_negative():
# Validation will happen during config parsing
driver = OpenPBSDriver()
await driver.submit(0, realization_memory="a_lot")
assert " -l mem=a_lot" in Path("captured_qsub_args").read_text(encoding="utf-8")
await driver.submit(0, "sleep", realization_memory=-1)
assert " -l " not in Path("captured_qsub_args").read_text(encoding="utf-8")


@pytest.mark.usefixtures("capturing_qsub")
Expand Down Expand Up @@ -261,7 +261,7 @@ async def started(iens):
assert was_started == started_expected


@given(words, st.integers(min_value=1), words)
@given(st.integers(), st.integers(min_value=1), words)
@pytest.mark.usefixtures("capturing_qsub")
async def test_full_resource_string(realization_memory, num_cpu, cluster_label):
driver = OpenPBSDriver(
Expand Down

0 comments on commit f3e2112

Please sign in to comment.