okami.mom/strata
git clone https://git.nkp.pet/okami.mom/strata
ea67f6999
main
1"""0.2.3 RC stress test #9 (C05, #3478): a missing shard is named, with its file name, in the CLI and in the TUI's own-files message.""" 2 3from strata_control import models 4from tests .terminal .test_own_files import Base ,Q2 5 6 7class MissingShardIsNamed (Base ): 8def test_the_plan_names_the_missing_second_shard (self ): 9folder = self .put (self .base / "half" ,Q2 [:1 ], ["Q2_0" ]) 10plan = models .plan_import (str (folder )) 11self .assertEqual (plan ["issues" ], ["incomplete_or_invalid_shard_set" ]) 12self .assertEqual (len (plan ["missing_shards" ]),1 ) 13name = plan ["missing_shards" ][0 ] 14self .assertRegex (name ,r"-00002-of-0000[0-9]\.gguf$" ) 15self .assertEqual (models .problem_words (plan ["issues" ],missing = plan ["missing_shards" ]),f" { name } is missing" ) 16self .assertEqual (plan ["plain_issues" ], [f" { name } is missing" ]) 17 18def test_without_a_name_the_old_sentence_stays (self ): 19self .assertEqual (models .problem_words (["incomplete_or_invalid_shard_set" ]),"some parts of the model are missing" ) 20 21def test_several_missing_shards_are_counted (self ): 22self .assertEqual (models .missing_words (["a-00002-of-00004.gguf" ,"a-00003-of-00004.gguf" ]), 23"a-00002-of-00004.gguf and a-00003-of-00004.gguf are missing" ) 24self .assertEqual (models .missing_words (["a-2" ,"a-3" ,"a-4" ,"a-5" ]),"a-2, a-3 and 2 more files are missing" ) 25 26def test_launch_plan_message_carries_the_file_name (self ): 27from tests .terminal .launch_support import run_cli 28folder = self .put (self .base / "half2" ,Q2 [:1 ], ["Q2_0" ]) 29code ,out ,err = run_cli (["launch" ,"--plan" ,"--model-path" ,str (folder )]) 30self .assertNotEqual (code ,0 ) 31self .assertRegex (err + out ,r"-00002-of-0000[0-9]\.gguf is missing" )