MCPcopy Create free account
hub / github.com/vastsa/FileCodeBox / RetrieveCodeTests

Class RetrieveCodeTests

tests/test_issue_473_retrieve_code.py:20–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18
19
20class RetrieveCodeTests(unittest.TestCase):
21 def test_normalize_share_code_strips_surrounding_whitespace(self):
22 self.assertEqual(normalize_share_code(" 12345\n"), "12345")
23
24 def test_get_code_file_by_code_queries_normalized_code(self):
25 original_file_codes = views.FileCodes
26 views.FileCodes = FakeFileCodes
27 try:
28 has_file, message = asyncio.run(views.get_code_file_by_code(" 12345\n"))
29 finally:
30 views.FileCodes = original_file_codes
31
32 self.assertFalse(has_file)
33 self.assertEqual(message, "文件不存在")
34 self.assertEqual(FakeFileCodes.seen_code, "12345")

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected