Retain bounded native probe failure diagnostics before cleanup
Assistant: codex Assistant-Model: gpt-6-astra Assistant-Session: 01a07ff8-19d0-7820-b4d0-1353833cb7fc
This commit is contained in:
parent
426a0d5829
commit
aaa4b8e686
3 changed files with 47 additions and 5 deletions
|
|
@ -17,6 +17,13 @@ import native_factory_acceptance as native
|
|||
|
||||
|
||||
class Contracts(unittest.TestCase):
|
||||
def test_failure_diagnostic_discards_unrecognized_content(self):
|
||||
fixture={'error':'secret-like-unrecognized-content','child_error':'native_accept_duplicate_not_observed',
|
||||
'phase':'lost-receipt','observed_http_statuses':[400],'Authorization':'must-never-be-retained'}
|
||||
self.assertEqual(native.failure_diagnostic(json.dumps(fixture).encode()),
|
||||
{'child_error':'native_accept_duplicate_not_observed','phase':'lost-receipt','observed_http_statuses':[400]})
|
||||
self.assertEqual(native.failure_diagnostic(b'non-json secret-like text'),{'error':'probe_diagnostic_unavailable'})
|
||||
|
||||
def test_jobs_do_not_read_operator_credentials_and_refuse_additive_egress(self):
|
||||
result=subprocess.CompletedProcess([],0,b'{"items":[{"metadata":{"name":"existing-allow"}}]}',b'')
|
||||
with patch.object(native,'receiver_check',return_value={}),patch.object(native,'command',return_value=result) as cmd,patch.object(native,'bao',side_effect=AssertionError('no OpenBao call permitted')):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue