Example #1
0
def test_from_pypi_name_response():
    repo = NixpkgsData(PYTESTRUNNER_DATA)
    drvs = repo.from_pypi_name('pytest-runner')
    assert isinstance(drvs, list)
    assert isinstance(drvs[0], NixPackage)
    assert drvs[0].attr == 'pytestrunner'
    assert drvs[0].version == parse('5.1')
Example #2
0
def test_canonicalize():
    repo = NixpkgsData(PYTESTRUNNER_DATA)
    repo.from_pypi_name('PYTEST_RUNNER')
Example #3
0
def test_not_case_sensitive():
    repo = NixpkgsData(ZSTD_DATA)
    repo.from_pypi_name('ZSTD')
Example #4
0
def test_invalid_pypi_name():
    repo = NixpkgsData({})
    with pytest.raises(PackageNotFound):
        repo.from_pypi_name('zstd')
    with pytest.raises(PackageNotFound):
        repo.from_requirement(Requirement('zstd'))
Example #5
0
def test_parse_json():
    repo = NixpkgsData(ZSTD_DATA)
    repo.from_pypi_name('zstd')