MCPcopy Create free account
hub / github.com/airbnb/binaryalert / _verify_filenames

Method _verify_filenames

tests/lambda_functions/build_test.py:32–41  ·  view source on GitHub ↗

Verify the set of filenames in the zip archive matches the expected list.

(self, archive_path: str, expected_filenames: Set[str],
                          subset: bool = False)

Source from the content-addressed store, hash-verified

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):

Callers 1

test_build_allMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected