pypiserver/tests/test_core.py
Ralf Schmitt dc0303bb1f add some tests for the pytz issue #6
pytz's version is '2012b' which we currently don't recognize as a
version string.
2012-03-26 00:59:59 +02:00

21 lines
587 B
Python
Executable File

#! /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)