def test_check_no_matching_sign_url(self): """ Test a package that does not have simple signature pattern """ with tempfile.TemporaryDirectory() as tmpd: out_file = os.path.join(tmpd, os.path.basename(NOSIGN_PKT_URL)) attempt_to_download(NOSIGN_PKT_URL, out_file) result = check(NOSIGN_PKT_URL, tmpd) self.assertEqual(result, None)
def test_check_with_existing_sign(self): """ Download signature for local verification """ with tempfile.TemporaryDirectory() as tmpd: out_file = os.path.join(tmpd, os.path.basename(NOSIGN_PKT_URL)) attempt_to_download(NOSIGN_PKT_URL, out_file) key_file = os.path.join(tmpd, os.path.basename(NOSIGN_PKT_URL)) attempt_to_download(NOSIGN_SIGN_URL, key_file + '.asc') result = check(NOSIGN_PKT_URL, tmpd) self.assertTrue(result)
def test_check_matching_sign_url(self): with tempfile.TemporaryDirectory() as tmpd: out_file = os.path.join(tmpd, os.path.basename(ALEMBIC_PKT_URL)) attempt_to_download(ALEMBIC_PKT_URL, out_file) result = check(ALEMBIC_PKT_URL, tmpd) self.assertTrue(result)