From ac32e89e99084cd9fd7e67cf1a36ffd7c20bb2c9 Mon Sep 17 00:00:00 2001 From: Jean Scherf Date: Wed, 10 Jun 2026 11:22:26 -0300 Subject: [PATCH] test(destination): add regression test for multi-label OData filter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Verifies that ListOptions with multiple filter_labels generates a valid OData HAS expression joined by AND, using real label keys from the sap-managed-runtime domain (AFSDK-3656). The no-parens format is what the Destination Service API accepts. Parenthesized clauses return 400 — confirmed against live API. --- tests/destination/unit/test_models.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/destination/unit/test_models.py b/tests/destination/unit/test_models.py index 7fa78271..c72df1c6 100644 --- a/tests/destination/unit/test_models.py +++ b/tests/destination/unit/test_models.py @@ -767,6 +767,17 @@ def test_multiple_labels_joined_with_and(self): params = opts.to_query_params() assert params["$filter"] == "Label['env'] HAS ('prod') AND Label['team'] HAS ('platform')" + def test_multiple_labels_real_keys(self): + opts = ListOptions(filter_labels=[ + Label(key="sap-managed-runtime-type", values=["agw.a2a.server"]), + Label(key="sap-managed-runtime-ordid", values=["d95a09d8-2152-40c9-abfd-52f3a53f6150"]), + ]) + params = opts.to_query_params() + assert params["$filter"] == ( + "Label['sap-managed-runtime-type'] HAS ('agw.a2a.server') AND " + "Label['sap-managed-runtime-ordid'] HAS ('d95a09d8-2152-40c9-abfd-52f3a53f6150')" + ) + def test_filter_labels_and_filter_names_raises(self): opts = ListOptions( filter_names=["dest1"],