Skip to content

Commit

Permalink
Added simple tests and CI (#140)
Browse files Browse the repository at this point in the history
* add 2 basic unit tests

* Add Github workflow for pytest run

* Various cleanups

Co-authored-by: Benjamin Greiner <[email protected]>
  • Loading branch information
alex and bnavigator authored Nov 25, 2020
1 parent 015cba9 commit f524f41
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
include MANIFEST.in README.rst LICENSE certifi/cacert.pem

exclude .github/
recursive-exclude .github
Empty file added certifi/tests/__init__.py
Empty file.
15 changes: 15 additions & 0 deletions certifi/tests/test_certify.py
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit f524f41

Please sign in to comment.