Skip to content

Commit

Permalink
[oarsub] add test for -p with sql clause
Browse files Browse the repository at this point in the history
  • Loading branch information
augu5te committed Sep 24, 2024
1 parent 1248a58 commit 909bc9f
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion tests/cli/test_oarsub.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def minimal_db_initialization(request, setup_config):
with ephemeral_session(scoped, engine, bind=engine) as session:
# add some resources
for i in range(5):
Resource.create(session, network_address="localhost")
Resource.create(session, network_address=f"localhost{i}")

Queue.create(session, name="default")
yield session
Expand Down Expand Up @@ -317,6 +317,28 @@ def test_oarsub_sleep_not_enough_resources_1(
)


def test_oarsub_sleep_property_sql(
monkeypatch, minimal_db_initialization, setup_config
):
config, _ = setup_config

runner = CliRunner()
result = runner.invoke(
cli,
# ["-q default", "-l resource_id=1", "-p network_address='localhost2'", '"sleep 1"'], #OK
[
"-q default",
"-l resource_id=1",
"-p network_address in ('localhost2', 'localhost1')",
'"sleep 1"',
], # OK
obj=(minimal_db_initialization, config),
)

print(result.output)
assert result.exit_code == 0


def test_oarsub_sleep_property_error(
monkeypatch, minimal_db_initialization, setup_config
):
Expand Down

0 comments on commit 909bc9f

Please sign in to comment.