Verify the set of filenames in the zip archive matches the expected list.
(self, archive_path: str, expected_filenames: Set[str],
subset: bool = False)
| 30 | self._tempdir = tempfile.gettempdir() |
| 31 | |
| 32 | def _verify_filenames(self, archive_path: str, expected_filenames: Set[str], |
| 33 | subset: bool = False): |
| 34 | """Verify the set of filenames in the zip archive matches the expected list.""" |
| 35 | with zipfile.ZipFile(archive_path, 'r') as archive: |
| 36 | filenames = set(zip_info.filename for zip_info in archive.filelist) |
| 37 | |
| 38 | if subset: |
| 39 | self.assertTrue(expected_filenames.issubset(filenames)) |
| 40 | else: |
| 41 | self.assertEqual(expected_filenames, filenames) |
| 42 | |
| 43 | @mock.patch.object(build.subprocess, 'check_call', side_effect=_mock_pip_main) |
| 44 | def test_build_all(self, mock_pip: mock.MagicMock, mock_print: mock.MagicMock): |