883 files, from working commit b1a079a. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
28 lines
1.4 KiB
Python
28 lines
1.4 KiB
Python
#!/usr/bin/env python3
|
|
"""The requested ID and IsLoaded do not overrule the client's error-cube logs."""
|
|
from pathlib import Path
|
|
import sys
|
|
import unittest
|
|
sys.path.insert(0,str(Path(__file__).resolve().parents[1]/'ops'))
|
|
from native_model_probe import model_stream_failures
|
|
|
|
|
|
class ModelEvidenceTest(unittest.TestCase):
|
|
def test_actual_loader_failures_are_typed_and_deduplicated(self):
|
|
line="[0] Non-fatal File Read error -- File : FileData ID 8528115, Reason : Can't find file in build manifest"
|
|
text=line+'\n'+line+'\nStreaming failed -- FileData ID 8528117 [Invalid file handle]. Errorstack:'
|
|
self.assertEqual(model_stream_failures(text,{8528115,8528117}),[
|
|
dict(file_data_id=8528115,stage='manifest-lookup',reason='file-absent-from-build-manifest'),
|
|
dict(file_data_id=8528117,stage='stream-open',reason='invalid-file-handle')])
|
|
|
|
def test_unrelated_ids_and_log_content_are_not_exported(self):
|
|
text="unrelated private text\nFileData ID 999, Reason : Can't find file in build manifest\nFileData ID 123 loaded"
|
|
self.assertEqual(model_stream_failures(text,{123}),[])
|
|
|
|
def test_bounds_and_boolean_ids_reject(self):
|
|
for text,ids in((b'raw',{1}),('x'*1048577,{1}),('',set()),('',{True}),('',{0}),('',set(range(1,34)))):
|
|
with self.assertRaises(ValueError):model_stream_failures(text,ids)
|
|
|
|
|
|
if __name__=='__main__':unittest.main()
|