-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from gabrielmscampos/feat/oms-proxy-client-tests
tests: add oms proxy client tests
- Loading branch information
Showing
2 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
from cmsdials.filters import OMSFilter, OMSPage | ||
|
||
from .utils import setup_dials_object | ||
|
||
|
||
def test_query_runs() -> None: | ||
dials = setup_dials_object() | ||
data = dials.oms.query( | ||
endpoint="runs", filters=[OMSFilter(attribute_name="run_number", value=382921, operator="EQ")] | ||
) | ||
assert isinstance(data, dict) | ||
assert data["meta"]["totalResourceCount"] == 1 | ||
|
||
|
||
def test_query_lumisections() -> None: | ||
dials = setup_dials_object() | ||
data = dials.oms.query( | ||
endpoint="lumisections", | ||
filters=[OMSFilter(attribute_name="run_number", value=382921, operator="EQ")], | ||
pages=[OMSPage(attribute_name="limit", value=5000)], | ||
) | ||
assert isinstance(data, dict) | ||
assert data["meta"]["totalResourceCount"] > 100 | ||
|
||
|
||
def test_query_datasetrates() -> None: | ||
dials = setup_dials_object() | ||
data = dials.oms.query( | ||
endpoint="datasetrates", | ||
filters=[ | ||
OMSFilter(attribute_name="run_number", value=382921, operator="EQ"), | ||
OMSFilter(attribute_name="dataset_name", value="ZeroBias", operator="EQ"), | ||
], | ||
pages=[OMSPage(attribute_name="limit", value=5000)], | ||
) | ||
assert isinstance(data, dict) | ||
assert data["meta"]["totalResourceCount"] > 100 |