Skip to content

Commit

Permalink
tests: extend test to check for datapoitns
Browse files Browse the repository at this point in the history
  • Loading branch information
doctrino committed Dec 30, 2024
1 parent 2179084 commit fdbf26f
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions tests/test_integration/test_graphql_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def test_query_with_datapoints(turbine_client: WindTurbineClient) -> None:
temperature{
externalId
name
getDataPoints(granularity: "1d", aggregates: SUM){
getDataPoints(granularity: "1d", aggregates: SUM, first: 100){
items{
timestamp
sum
Expand All @@ -182,8 +182,13 @@ def test_query_with_datapoints(turbine_client: WindTurbineClient) -> None:
)
assert len(result) == 1
item = result[0]
# Currently (16/11/2024 - there is now datapoints in the timeseries)
assert isinstance(item, wdc.MetmastGraphQL)
assert item.temperature is not None
assert item.temperature.data is not None
assert item.temperature.data.sum is not None
assert len(item.temperature.data.sum) > 0
assert item.temperature.data.timestamp is not None
assert len(item.temperature.data.timestamp) > 0


def test_query_latest_datapoint(turbine_client: WindTurbineClient) -> None:
Expand All @@ -209,5 +214,10 @@ def test_query_latest_datapoint(turbine_client: WindTurbineClient) -> None:
)
assert len(result) == 1
item = result[0]
# Currently (16/11/2024 - there is now datapoints in the timeseries)
assert isinstance(item, wdc.MetmastGraphQL)
assert item.temperature is not None
assert item.temperature.data is not None
assert item.temperature.data.timestamp is not None
assert item.temperature.data.value is not None
assert len(item.temperature.data.timestamp) == 1
assert len(item.temperature.data.value) == 1

0 comments on commit fdbf26f

Please sign in to comment.