| 242 | |
| 243 | |
| 244 | class TestClassifyAlreadyStored(unittest.TestCase): |
| 245 | def setUp(self) -> None: |
| 246 | _PATCH_SOURCE.start() |
| 247 | self.addCleanup(_PATCH_SOURCE.stop) |
| 248 | |
| 249 | @patch("os.path.islink", return_value=False) |
| 250 | def test_already_stored_no_overwrite(self, _il) -> None: |
| 251 | s = _FakeStore(sources_in_db={"u/26.04/1/foo.1.gz"}) |
| 252 | c = _make_classifier(s) |
| 253 | self.assertIsInstance(c.classify("/x/u/26.04/1/foo.1.gz"), AlreadyStored) |
| 254 | |
| 255 | @patch("os.path.islink", return_value=False) |
| 256 | @patch("explainshell.extraction.common.gz_sha256", return_value="h") |
| 257 | def test_overwrite_skips_already_stored_branch(self, _h, _il) -> None: |
| 258 | s = _FakeStore(sources_in_db={"u/26.04/1/foo.1.gz"}) |
| 259 | c = _make_classifier(s, overwrite=True) |
| 260 | # No filter, no dedup hit → falls through to Work. |
| 261 | self.assertIsInstance(c.classify("/x/u/26.04/1/foo.1.gz"), Work) |
| 262 | |
| 263 | |
| 264 | class TestClassifyContentDup(unittest.TestCase): |
nothing calls this directly
no outgoing calls
no test coverage detected