def test_message_trace_params_dropped_in_hsm(hsm_enabled): @background_task() def _test(): with MessageTrace("library", "operation", "dest_type", "dest_name", params={"secret": "super secret"}): pass if hsm_enabled: _test = override_application_settings(_test_transaction_settings_hsm_enabled_capture_params)(_test) _test = validate_tt_segment_params(forgone_params=("secret",))(_test) else: _test = override_application_settings(_test_transaction_settings_hsm_disabled)(_test) _test = validate_tt_segment_params(present_params=("secret",))(_test) _test()
def test_function_trace_params_dropped_in_hsm(hsm_enabled): @background_task() def _test(): with FunctionTrace('trace', params={'secret': 'super secret'}): pass if hsm_enabled: _test = override_application_settings( _test_transaction_settings_hsm_enabled_capture_params)(_test) _test = validate_tt_segment_params(forgone_params=('secret', ))(_test) else: _test = override_application_settings( _test_transaction_settings_hsm_disabled)(_test) _test = validate_tt_segment_params(present_params=('secret', ))(_test) _test()