15
0
2024-07-09 07:12:42 +00:00
committed by Git OBS Bridge
parent 8135f90041
commit 221cccf0a4
3 changed files with 44 additions and 29 deletions

View File

@@ -11,14 +11,18 @@ Subject: [PATCH 1/2] add 2 basic unit tests
create mode 100644 certifi/tests/__init__.py
create mode 100755 certifi/tests/test_certifi.py
Index: certifi-2024.7.4/certifi/tests/__init__.py
===================================================================
--- /dev/null
+++ b/certifi/tests/__init__.py
+++ certifi-2024.7.4/certifi/tests/__init__.py
@@ -0,0 +1,2 @@
+# certifi.tests module
+
Index: certifi-2024.7.4/certifi/tests/test_certifi.py
===================================================================
--- /dev/null
+++ b/certifi/tests/test_certifi.py
@@ -0,0 +1,19 @@
+++ certifi-2024.7.4/certifi/tests/test_certifi.py
@@ -0,0 +1,23 @@
+# -*- coding: utf-8 -*-
+"""
+unit tests to make sure everything behaves as expected
@@ -31,15 +35,21 @@ Subject: [PATCH 1/2] add 2 basic unit tests
+
+
+class TestCertifi(unittest.TestCase):
+ def test_cabundle_exists(self):
+ """Check that the reported bundle exists"""
+ self.assertTrue(os.path.exists(certifi.where()))
+ def test_cabundle_exists(self) -> None:
+ assert os.path.exists(certifi.where())
+
+ def test_read_contents(self):
+ """Check that the returned contents contain a certificate"""
+ self.assertIn("-----BEGIN CERTIFICATE-----", certifi.contents())
+ def test_read_contents(self) -> None:
+ content = certifi.contents()
+ assert "-----BEGIN CERTIFICATE-----" in content
+
+ def test_py_typed_exists(self) -> None:
+ assert os.path.exists(
+ os.path.join(os.path.dirname(certifi.__file__), 'py.typed')
+ )
Index: certifi-2024.7.4/.github/workflows/python-package.yml
===================================================================
--- /dev/null
+++ b/.github/workflows/python-package.yml
+++ certifi-2024.7.4/.github/workflows/python-package.yml
@@ -0,0 +1,40 @@
+# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
+# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions