Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions monitoring/prober/scd/test_constraint_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,19 @@ def test_create_constraint_missing_time_end(ids, scd_api, scd_session):
assert resp.status_code == 400, resp.content


@for_api_versions(scd.API_0_3_17)
@default_scope(SCOPE_CM)
@depends_on(test_ensure_clean_workspace)
def test_create_constraint_time_start_after_time_end(ids, scd_api, scd_session):
req = _make_c1_request()
e = req["extents"][0]
t = e["time_end"]
e["time_end"] = e["time_start"]
e["time_start"] = t
resp = scd_session.put(f"/constraint_references/{ids(CONSTRAINT_TYPE)}", json=req)
assert resp.status_code == 400, resp.content


@for_api_versions(scd.API_0_3_17)
@depends_on(test_ensure_clean_workspace)
def test_create_constraint(ids, scd_api, scd_session):
Expand Down
12 changes: 12 additions & 0 deletions monitoring/prober/scd/test_operation_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,18 @@ def test_create_op_missing_time_end(ids, scd_api, scd_session):
assert resp.status_code == 400, resp.content


@default_scope(SCOPE_SC)
@depends_on(test_ensure_clean_workspace)
def test_create_op_time_start_after_time_end(ids, scd_api, scd_session):
req = _make_op1_request()
e = req["extents"][0]
time_end = e["time_end"]
e["time_end"] = e["time_start"]
e["time_start"] = time_end
resp = scd_session.put(f"/operational_intent_references/{ids(OP_TYPE)}", json=req)
assert resp.status_code == 400, resp.content


@depends_on(test_ensure_clean_workspace)
def test_create_op(ids, scd_api, scd_session, scd_session_cp, scd_session_cm):
req = _make_op1_request()
Expand Down
12 changes: 12 additions & 0 deletions monitoring/prober/scd/test_subscription_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,18 @@ def test_sub_does_not_exist_query(ids, scd_api, scd_session):
]


@for_api_versions(scd.API_0_3_17)
@default_scope(SCOPE_SC)
def test_create_sub_time_start_after_time_end(ids, scd_api, scd_session):
req = _make_sub1_req(scd_api)
e = req["extents"]
time_end = e["time_end"]
e["time_end"] = e["time_start"]
e["time_start"] = time_end
resp = scd_session.put(f"/subscriptions/{ids(SUB_TYPE)}", json=req)
assert resp.status_code == 400, resp.content


@for_api_versions(scd.API_0_3_17)
@default_scope(SCOPE_SC)
def test_create_sub(ids, scd_api, scd_session):
Expand Down
Loading