mirror of
https://github.com/lilydjwg/nvchecker.git
synced 2025-03-10 06:14:02 +00:00
port more tests
This commit is contained in:
parent
7de923c1e1
commit
61a67a4a5b
9 changed files with 40 additions and 30 deletions
|
@ -13,5 +13,5 @@ async def get_version(name, conf, *, cache, **kwargs):
|
||||||
if version != "dev-master"
|
if version != "dev-master"
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data):
|
if len(versions):
|
||||||
return max(data, key=lambda version: versions[version]["time"])
|
return max(versions, key=lambda version: versions[version]["time"])
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
# MIT licensed
|
|
||||||
# Copyright (c) 2013-2017 lilydjwg <lilydjwg@gmail.com>, et al.
|
|
||||||
|
|
||||||
import pytest
|
|
||||||
pytestmark = [pytest.mark.asyncio, pytest.mark.needs_net]
|
|
||||||
|
|
||||||
async def test_gems(get_version):
|
|
||||||
assert await get_version("example", {"gems": None}) == "1.0.2"
|
|
|
@ -1,8 +0,0 @@
|
||||||
# MIT licensed
|
|
||||||
# Copyright (c) 2013-2017 lilydjwg <lilydjwg@gmail.com>, et al.
|
|
||||||
|
|
||||||
import pytest
|
|
||||||
pytestmark = [pytest.mark.asyncio, pytest.mark.needs_net]
|
|
||||||
|
|
||||||
async def test_hackage(get_version):
|
|
||||||
assert await get_version("sessions", {"hackage": None}) == "2008.7.18"
|
|
|
@ -1,8 +0,0 @@
|
||||||
# MIT licensed
|
|
||||||
# Copyright (c) 2013-2017 lilydjwg <lilydjwg@gmail.com>, et al.
|
|
||||||
|
|
||||||
import pytest
|
|
||||||
pytestmark = [pytest.mark.asyncio, pytest.mark.needs_net]
|
|
||||||
|
|
||||||
async def test_npm(get_version):
|
|
||||||
assert await get_version("example", {"npm": None}) == "0.0.0"
|
|
|
@ -1,8 +1,10 @@
|
||||||
# MIT licensed
|
# MIT licensed
|
||||||
# Copyright (c) 2013-2017 lilydjwg <lilydjwg@gmail.com>, et al.
|
# Copyright (c) 2013-2020 lilydjwg <lilydjwg@gmail.com>, et al.
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
pytestmark = [pytest.mark.asyncio, pytest.mark.needs_net]
|
pytestmark = [pytest.mark.asyncio, pytest.mark.needs_net]
|
||||||
|
|
||||||
async def test_cpan(get_version):
|
async def test_cpan(get_version):
|
||||||
assert await get_version("POE-Component-Server-HTTPServer", {"cpan": None}) == "0.9.2"
|
assert await get_version("POE-Component-Server-HTTPServer", {
|
||||||
|
"source": "cpan",
|
||||||
|
}) == "0.9.2"
|
10
tests/test_gems.py
Normal file
10
tests/test_gems.py
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
# MIT licensed
|
||||||
|
# Copyright (c) 2013-2020 lilydjwg <lilydjwg@gmail.com>, et al.
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
pytestmark = [pytest.mark.asyncio, pytest.mark.needs_net]
|
||||||
|
|
||||||
|
async def test_gems(get_version):
|
||||||
|
assert await get_version("example", {
|
||||||
|
"source": "gems",
|
||||||
|
}) == "1.0.2"
|
10
tests/test_hackage.py
Normal file
10
tests/test_hackage.py
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
# MIT licensed
|
||||||
|
# Copyright (c) 2013-2020 lilydjwg <lilydjwg@gmail.com>, et al.
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
pytestmark = [pytest.mark.asyncio, pytest.mark.needs_net]
|
||||||
|
|
||||||
|
async def test_hackage(get_version):
|
||||||
|
assert await get_version("sessions", {
|
||||||
|
"source": "hackage",
|
||||||
|
}) == "2008.7.18"
|
10
tests/test_npm.py
Normal file
10
tests/test_npm.py
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
# MIT licensed
|
||||||
|
# Copyright (c) 2013-2020 lilydjwg <lilydjwg@gmail.com>, et al.
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
pytestmark = [pytest.mark.asyncio, pytest.mark.needs_net]
|
||||||
|
|
||||||
|
async def test_npm(get_version):
|
||||||
|
assert await get_version("example", {
|
||||||
|
"source": "npm",
|
||||||
|
}) == "0.0.0"
|
|
@ -1,8 +1,10 @@
|
||||||
# MIT licensed
|
# MIT licensed
|
||||||
# Copyright (c) 2013-2017 lilydjwg <lilydjwg@gmail.com>, et al.
|
# Copyright (c) 2013-2020 lilydjwg <lilydjwg@gmail.com>, et al.
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
pytestmark = [pytest.mark.asyncio, pytest.mark.needs_net]
|
pytestmark = [pytest.mark.asyncio, pytest.mark.needs_net]
|
||||||
|
|
||||||
async def test_packagist(get_version):
|
async def test_packagist(get_version):
|
||||||
assert await get_version("butterfly/example-web-application", {"packagist": None}) == "1.2.0"
|
assert await get_version("butterfly/example-web-application", {
|
||||||
|
"source": "packagist",
|
||||||
|
}) == "1.2.0"
|
Loading…
Add table
Reference in a new issue