mirror of
https://github.com/pypiserver/pypiserver
synced 2025-02-22 19:19:37 +01:00
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:
parent
fca2f46868
commit
dc0303bb1f
@ -13,5 +13,6 @@ include pypiserver/manage.py
|
|||||||
include setup.cfg
|
include setup.cfg
|
||||||
include setup.py
|
include setup.py
|
||||||
include tests/test_app.py
|
include tests/test_app.py
|
||||||
|
include tests/test_core.py
|
||||||
include tests/test_main.py
|
include tests/test_main.py
|
||||||
include tox.ini
|
include tox.ini
|
||||||
|
20
tests/test_core.py
Executable file
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)
|
Loading…
Reference in New Issue
Block a user