Skip to content

Commit

Permalink
A couple of smoke tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mgedmin committed Dec 11, 2018
1 parent c8ef00e commit 26d55b5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import ast
import sys

import pytest

import check_python_versions as cpv


def test_pipe():
assert cpv.pipe('echo', 'hi') == 'hi\n'


def test_get_versions_from_classifiers():
assert cpv.get_versions_from_classifiers([
'Development Status :: 4 - Beta',
Expand Down Expand Up @@ -148,3 +153,9 @@ def test_important():

def test_parse_expect():
assert cpv.parse_expect('2.7,3.4-3.6') == ['2.7', '3.4', '3.5', '3.6']


def test_main_help(monkeypatch):
monkeypatch.setattr(sys, 'argv', ['check-python-versions', '--help'])
with pytest.raises(SystemExit):
cpv.main()

0 comments on commit 26d55b5

Please sign in to comment.