@@ -41,30 +41,7 @@ def _get_token_client_credentials(client_id, private_key):
4141
4242 return token_resp .json ()["access_token" ]
4343
44- @pytest .mark .parametrize (
45- "new_attribute,flow_vars_to_check" ,
46- [
47- pytest .param (
48- {
49- "name" : "apim-app-flow-vars" ,
50- "value" : '{"proxy":{"allowed":{"update":true}}}' ,
51- },
52- [{"name" : "apim-app-flow-vars.proxy.allowed.update" , "value" : "true" }],
53- id = "Single attribute" ,
54- ),
55- pytest .param (
56- {
57- "name" : "apim-app-flow-vars" ,
58- "value" : '{"attr_a": "value_a", "attr_b": "value_b"}' ,
59- },
60- [
61- {"name" : "apim-app-flow-vars.attr_a" , "value" : "value_a" },
62- {"name" : "apim-app-flow-vars.attr_b" , "value" : "value_b" },
63- ],
64- id = "Multiple attributes" ,
65- ),
66- ],
67- )
44+
6845 def test_single_asid_apply (
6946 self ,
7047 nhsd_apim_proxy_url ,
@@ -112,77 +89,3 @@ def test_single_asid_apply(
11289 )
11390
11491 trace .delete_debugsession_by_name (session_name )
115-
116- # @pytest.mark.nhsd_apim_authorization(access="application", level="level3")
117- # def test_no_attribute(
118- # self,
119- # nhsd_apim_proxy_url,
120- # nhsd_apim_auth_headers,
121- # trace,
122- # ):
123- # # Trace call to shared flow proxy extended attributes endpoint
124- # session_name = str(uuid4())
125- # header_filters = {"trace_id": session_name}
126- # trace.post_debugsession(session=session_name, header_filters=header_filters)
127-
128- # proxy_resp = requests.get(
129- # url=f"{nhsd_apim_proxy_url}/single-asid",
130- # headers={**nhsd_apim_auth_headers, **header_filters},
131- # )
132- # assert proxy_resp.status_code == 200
133-
134- # # Extract variable from trace and assert
135- # extended_attributes = get_variable_from_trace(
136- # trace, session_name, "app.apim-app-flow-vars"
137- # )
138-
139- # trace.delete_debugsession_by_name(session_name)
140-
141- # assert not extended_attributes
142-
143- # def test_invalid_json(
144- # self,
145- # nhsd_apim_proxy_url,
146- # _create_function_scoped_test_app,
147- # _proxy_product_with_scope,
148- # _jwt_keys,
149- # developer_apps_api,
150- # nhsd_apim_config,
151- # trace,
152- # ):
153- # new_attribute = {
154- # "name": "apim-app-flow-vars",
155- # "value": '{"proxy":{{"allowed":{"update":true}}}',
156- # }
157-
158- # # Update test app with proxy product and the extended attribute
159- # app = _create_function_scoped_test_app
160- # app["apiProducts"] = [_proxy_product_with_scope["name"]]
161- # app["attributes"].append(new_attribute)
162- # app = developer_apps_api.put_app_by_name(
163- # email=nhsd_apim_config["APIGEE_DEVELOPER"], app_name=app["name"], body=app
164- # )
165-
166- # # Trace call to shared flow proxy extended attributes endpoint
167- # session_name = str(uuid4())
168- # header_filters = {"trace_id": session_name}
169- # trace.post_debugsession(session=session_name, header_filters=header_filters)
170-
171- # access_token = self._get_token_client_credentials(
172- # client_id=app["credentials"][0]["consumerKey"],
173- # private_key=_jwt_keys["private_key_pem"],
174- # )
175- # proxy_resp = requests.get(
176- # url=f"{nhsd_apim_proxy_url}/single-asid",
177- # headers={"Authorization": f"Bearer {access_token}", **header_filters},
178- # )
179- # assert proxy_resp.status_code == 500
180-
181- # # Var is None unless the InvalidJson RaiseFault error has been thrown
182- # raise_fault_var = get_variable_from_trace(
183- # trace, session_name, "raisefault.RaiseFault.InvalidJson"
184- # )
185-
186- # trace.delete_debugsession_by_name(session_name)
187-
188- # assert raise_fault_var is not None
0 commit comments