def test_accepted_file_types_sig(self, git_repo: Mock) -> None: artifacts = [ "bad-xml.xml", "the-jar.jar", "the-zip.zip", "the-whl.whl", "the-rpm.rpm", "the-war.war", "the-pom.pom", "the-module.module", "the-tar.tar.gz", "random-file.txt", "something-1.0.0.0.jar", "opensearch_sql_cli-1.0.0-py3-none-any.whl", "cratefile.crate" ] expected = [ call(os.path.join("path", "the-jar.jar"), ".sig"), call(os.path.join("path", "the-zip.zip"), ".sig"), call(os.path.join("path", "the-whl.whl"), ".sig"), call(os.path.join("path", "the-rpm.rpm"), ".sig"), call(os.path.join("path", "the-war.war"), ".sig"), call(os.path.join("path", "the-pom.pom"), ".sig"), call(os.path.join("path", "the-module.module"), ".sig"), call(os.path.join("path", "the-tar.tar.gz"), ".sig"), call(os.path.join("path", "something-1.0.0.0.jar"), ".sig"), call(os.path.join("path", "opensearch_sql_cli-1.0.0-py3-none-any.whl"), ".sig"), call(os.path.join("path", "cratefile.crate"), ".sig") ] signer = Signer() signer.sign = MagicMock() # type: ignore signer.sign_artifacts(artifacts, Path("path"), ".sig") self.assertEqual(signer.sign.call_args_list, expected)
def test_accepted_file_types_asc(self, git_repo): artifacts = [ "bad-xml.xml", "the-jar.jar", "the-zip.zip", "the-war.war", "the-pom.pom", "the-module.module", "the-tar.tar.gz", "random-file.txt", "something-1.0.0.0.jar", ] expected = [ call(os.path.join("path", "the-jar.jar"), ".asc"), call(os.path.join("path", "the-zip.zip"), ".asc"), call(os.path.join("path", "the-war.war"), ".asc"), call(os.path.join("path", "the-pom.pom"), ".asc"), call(os.path.join("path", "the-module.module"), ".asc"), call(os.path.join("path", "the-tar.tar.gz"), ".asc"), call(os.path.join("path", "something-1.0.0.0.jar"), ".asc"), ] signer = Signer() signer.sign = MagicMock() signer.sign_artifacts(artifacts, "path", ".asc") self.assertEqual(signer.sign.call_args_list, expected)