From b2963f3ae09a26982c01f53180be0baced166703 Mon Sep 17 00:00:00 2001 From: jgjesdal Date: Tue, 29 Sep 2026 15:21:05 +0200 Subject: [PATCH 1/2] test(resources): give the graph projection test a unit external id that exists The platform now refuses a unitExternalId outside the unit catalogue, and 'celsius' is not in it; every other test uses temperature_deg_c. Co-Authored-By: Claude Opus 5.5 (1M context) Signed-off-by: jgjesdal --- src/resources/tests.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/resources/tests.rs b/src/resources/tests.rs index 45be52d..a103777 100644 --- a/src/resources/tests.rs +++ b/src/resources/tests.rs @@ -809,7 +809,7 @@ async fn graph_projection_is_one_to_one_and_typed() -> Result<(), Box "tv".to_string()}); From 0249ec24c5ef6e22da0baaa2407e3d5239cb69f2 Mon Sep 17 00:00:00 2001 From: jgjesdal Date: Wed, 30 Sep 2026 10:00:40 +0200 Subject: [PATCH 2/2] test(python): name only catalogue units by unitExternalId The api now refuses a unitExternalId outside the unit catalogue, on create and on update. The filter corpus used 'temperature_c' and the CRUD tests made ids up ('ext.unit.id', 'orig_unit_ext', 'clear.this.ext', 'updated_unit_ext'); they use temperature_deg_c and pressure_bar now. The offline constructor tests keep their made-up ids, since they never reach the api. Co-Authored-By: Claude Opus 5.5 (1M context) Signed-off-by: jgjesdal --- python_tests/filter_fixtures.py | 2 +- python_tests/test_filter_timeseries.py | 2 +- python_tests/test_timeseries_crud.py | 10 ++++------ 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/python_tests/filter_fixtures.py b/python_tests/filter_fixtures.py index 6416212..cd41efa 100644 --- a/python_tests/filter_fixtures.py +++ b/python_tests/filter_fixtures.py @@ -115,7 +115,7 @@ def timeseries_corpus(sync_client, datasets, prefix, token): ), "pump_x1": dict( external_id=f"{prefix}_ts_pumpX1", name=f"Pump Beta {token}", - unit="celsius", unit_external_id="temperature_c", value_type="float", + unit="celsius", unit_external_id="temperature_deg_c", value_type="float", data_set_id=child.id, metadata={f"tsk_{token}": "beta", f"tsshared_{token}": "yes"}, ), diff --git a/python_tests/test_filter_timeseries.py b/python_tests/test_filter_timeseries.py index 4495745..894f26f 100644 --- a/python_tests/test_filter_timeseries.py +++ b/python_tests/test_filter_timeseries.py @@ -211,7 +211,7 @@ def test_unit_external_ids_are_a_pattern_list(flt, timeseries_corpus): assert flt(unit_external_id=["pressure_bar"]) == { timeseries_corpus["pump_1"].external_id, timeseries_corpus["valve"].external_id } - assert flt(unit_external_id=["pressure_*", "temperature_c"]) == { + assert flt(unit_external_id=["pressure_*", "temperature_deg_c"]) == { ts.external_id for ts in timeseries_corpus.values() } diff --git a/python_tests/test_timeseries_crud.py b/python_tests/test_timeseries_crud.py index e651b71..964e2f1 100644 --- a/python_tests/test_timeseries_crud.py +++ b/python_tests/test_timeseries_crud.py @@ -46,7 +46,7 @@ def _refetch(sync_client, ts): {"value_type": "float", "metadata": {}}, {"value_type": "float", "metadata": {"empty_value": ""}}, {"value_type": "float", "description": "a described series"}, - {"value_type": "float", "unit": "m/s", "unit_external_id": "ext.unit.id"}, + {"value_type": "float", "unit": "bar", "unit_external_id": "pressure_bar"}, {"value_type": "float", "name": "Unicode ✓ 日本語 name"}, {"value_type": "float", "source": "sap_pi"}, ], @@ -144,9 +144,7 @@ def test_delete_by_external_id_string(sync_client): ("unit", "Updated Unit", "unit"), ("description", "Updated Description", "description"), ("source", "updated_source", "source"), - # unit_external_id is sanitised server-side (dots -> underscores), so the - # value here is already in canonical form to keep the assertion exact. - ("unit_external_id", "updated_unit_ext", "unit_external_id"), + ("unit_external_id", "pressure_bar", "unit_external_id"), ], ) def test_update_scalar_str_set_value(sync_client, make_ts, field, new_value, attr): @@ -154,7 +152,7 @@ def test_update_scalar_str_set_value(sync_client, make_ts, field, new_value, att name="Original", description="original description", unit="a.u", - unit_external_id="orig_unit_ext", + unit_external_id="temperature_deg_c", source="original_source", ) @@ -202,7 +200,7 @@ def test_update_scalar_str_set_null(sync_client, make_ts, field, attr): ts = make_ts( description="please clear me", unit="a.u", - unit_external_id="clear.this.ext", + unit_external_id="temperature_deg_c", source="please_clear_me", )