Example #1
0
def test_add_package_force():
    pkg1 = Package('test-0.0.1', ['foo'])
    pkg2 = Package('test-0.0.1', ['bar'])

    index = Index([pkg1])
    index.add_package(pkg2, force=True)
    assert index.packages == {pkg2}
Example #2
0
def test_add_package():
    pkg1 = Package('test-0.0.1', ['foo'])
    pkg2 = Package('test-0.0.2', ['bar'])

    index = Index([pkg1])
    index.add_package(pkg2)
    assert index.packages == {pkg1, pkg2}
Example #3
0
def test_add_package_exists():
    pkg1 = Package('test-0.0.1', ['foo'])
    pkg2 = Package('test-0.0.1', ['bar'])

    index = Index([pkg1])
    with pytest.raises(S3PyPiError):
        index.add_package(pkg2)
Example #4
0
def test_add_package_exists():
    pkg1 = Package("test-0.0.1", ["foo"])
    pkg2 = Package("test-0.0.1", ["bar"])

    index = Index([pkg1])
    with pytest.raises(S3PyPiError):
        index.add_package(pkg2)
Example #5
0
def test_add_package_force():
    pkg1 = Package("test-0.0.1", ["foo"])
    pkg2 = Package("test-0.0.1", ["bar"])

    index = Index([pkg1])
    index.add_package(pkg2, force=True)
    assert index.packages == {pkg2}
Example #6
0
def test_add_package():
    pkg1 = Package("test-0.0.1", ["foo"])
    pkg2 = Package("test-0.0.2", ["bar"])

    index = Index([pkg1])
    index.add_package(pkg2)
    assert index.packages == {pkg1, pkg2}
Example #7
0
def test_add_package_force():
    pkg1 = Package('test-0.0.1', ['foo'])
    pkg2 = Package('test-0.0.1', ['bar'])

    index = Index([pkg1])
    index.add_package(pkg2, force=True)
    assert index.packages == {pkg2}
Example #8
0
def test_add_package_exists():
    pkg1 = Package('test-0.0.1', ['foo'])
    pkg2 = Package('test-0.0.1', ['bar'])

    index = Index([pkg1])
    with pytest.raises(S3PyPiError):
        index.add_package(pkg2)
Example #9
0
def test_add_package():
    pkg1 = Package('test-0.0.1', ['foo'])
    pkg2 = Package('test-0.0.2', ['bar'])

    index = Index([pkg1])
    index.add_package(pkg2)
    assert index.packages == {pkg1, pkg2}
Example #10
0
def test_add_package_force():
    pkg1 = Package("test-0.0.1", ["foo"])
    pkg2 = Package("test-0.0.1", ["bar"])

    index = Index([pkg1])
    index.add_package(pkg2, force=True)

    assert len(index.packages) == 1
    assert next(iter(index.packages)).files == {"foo", "bar"}