Skip to content

Commit

Permalink
Merge pull request #15 from gabrielmscampos/feat/oms-proxy-client-tests
Browse files Browse the repository at this point in the history
tests: add oms proxy client tests
  • Loading branch information
gabrielmscampos authored Jul 31, 2024
2 parents 11489af + 30e58c8 commit c20b56c
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tests/integration/test_h2d_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

def test_get_h2d() -> None:
dials = setup_dials_object()
data = dials.h2d.get(dataset_id=14677060, run_number=367112, ls_number=10, me_id=96)
data = dials.h2d.get(dataset_id=14677060, run_number=367112, ls_number=10, me_id=133)
assert isinstance(data, LumisectionHistogram2D)


Expand Down
37 changes: 37 additions & 0 deletions tests/integration/test_oms_proxy_client.py
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

0 comments on commit c20b56c

Please sign in to comment.