add some tests for the pytz issue #6

pytz's version is '2012b' which we currently don't recognize as a
version string.
This commit is contained in:
Ralf Schmitt 2012-03-26 00:23:28 +02:00
parent fca2f46868
commit dc0303bb1f
2 changed files with 21 additions and 0 deletions

@ -13,5 +13,6 @@ include pypiserver/manage.py
include setup.cfg
include setup.py
include tests/test_app.py
include tests/test_core.py
include tests/test_main.py
include tox.ini

20
tests/test_core.py Executable file

@ -0,0 +1,20 @@
#! /usr/bin/env py.test
import pytest
from pypiserver import core
files = [
("pytz-2012b.tar.bz2", "pytz", "2012b"),
("pytz-2012b.tgz", "pytz", "2012b"),
("pytz-2012b.zip", "pytz", "2012b")]
@pytest.mark.parametrize(("filename", "pkgname", "version"), files)
def test_guess_pkgname(filename, pkgname, version):
assert core.guess_pkgname(filename) == pkgname
@pytest.mark.parametrize(("filename", "pkgname", "version"), files)
def test_guess_pkgname_and_version(filename, pkgname, version):
assert core.guess_pkgname_and_version(filename) == (pkgname, version)