Skip to content

Commit

Permalink
chore: little changes on test(waiting for comment resolution)
Browse files Browse the repository at this point in the history
Signed-off-by: joshuaunity <[email protected]>
  • Loading branch information
joshuaunity committed Sep 26, 2024
1 parent d80f1ba commit 461f1d2
Showing 1 changed file with 5 additions and 28 deletions.
33 changes: 5 additions & 28 deletions flexmeasures/api/v3_0/tests/test_assets_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,25 +119,8 @@ def test_get_assets(
assert turbine["account_id"] == setup_accounts["Supplier"].id


@pytest.mark.parametrize(
"requesting_user, account_name, num_assets, use_pagination",
[
("[email protected]", "Prosumer", 1, False),
("[email protected]", "Supplier", 2, False),
("[email protected]", "ConsultancyClient", 1, False),
("[email protected]", "Prosumer", 1, True),
],
indirect=["requesting_user"],
)
def test_fetch_asset_sensors(
client,
setup_api_test_data,
setup_accounts,
account_name,
num_sensors,
use_pagination,
requesting_user,
):
@pytest.mark.parametrize("requesting_user", ["[email protected]"], indirect=True)
def test_fetch_asset_sensors(client, setup_api_test_data, requesting_user):
"""
Retrieve all sensors associated with a specific asset.
Expand All @@ -149,13 +132,7 @@ def test_fetch_asset_sensors(
"""
asset_id = 5

query = {"": ""}
if use_pagination:
query["page"] = 1

response = client.get(
url_for("AssetAPI:asset_sensors", id=asset_id), query_string=query
)
response = client.get(url_for("AssetAPI:asset_sensors", id=asset_id))

print("Server responded with:\n%s" % response.json)

Expand All @@ -164,8 +141,8 @@ def test_fetch_asset_sensors(
assert isinstance(response.json["data"], list)
assert isinstance(response.json["data"][0], dict)
assert is_valid_unit(response.json["data"][0]["unit"])
assert response.json["num-records"] == num_sensors
assert response.json["filtered-records"] == num_sensors
assert response.json["num-records"] == 3
assert response.json["filtered-records"] == 3


@pytest.mark.parametrize("requesting_user", ["[email protected]"], indirect=True)
Expand Down

0 comments on commit 461f1d2

Please sign in to comment.