Added simple tests and CI (#140) * add 2 basic unit tests * Add Github workflow for pytest run * Various cleanups Co-authored-by: Benjamin Greiner <code@bnavigator.de>
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..8449664 --- /dev/null +++ b/.github/workflows/ci.yml
@@ -0,0 +1,27 @@ +name: CI + +on: + push: + branches: [master] + pull_request: {} + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.5, 3.6, 3.7, 3.8, 3.9] + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install test dependencies + run: | + python -m pip install --upgrade pip + pip install pytest + - name: Test with pytest + run: | + pytest
diff --git a/MANIFEST.in b/MANIFEST.in index 6077b5f..cb2f450 100644 --- a/MANIFEST.in +++ b/MANIFEST.in
@@ -1 +1,4 @@ include MANIFEST.in README.rst LICENSE certifi/cacert.pem + +exclude .github/ +recursive-exclude .github \ No newline at end of file
diff --git a/certifi/tests/__init__.py b/certifi/tests/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/certifi/tests/__init__.py
diff --git a/certifi/tests/test_certify.py b/certifi/tests/test_certify.py new file mode 100755 index 0000000..7fb8c77 --- /dev/null +++ b/certifi/tests/test_certify.py
@@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- + +import os +import unittest + +import certifi + + +class TestCertifi(unittest.TestCase): + def test_cabundle_exists(self): + assert os.path.exists(certifi.where()) + + def test_read_contents(self): + content = certifi.contents() + assert "-----BEGIN CERTIFICATE-----" in content