Esempio n. 1
0
def bootstrapdict():
    source = render_string(
        "devpibootstrap.py",
        INDEXURL="http://localhost:3141/root/dev",
        VIRTUALENVTARURL="http://localhost:3141/root/pypi/virtualenv-1.10.tar.gz",
        DEVPI_INSTALL_INDEX="http://localhost:3141/root/dev",
        TESTSPEC="pytest")
    d = {}
    py.builtin.exec_(py.code.compile(source), d)
    return d
Esempio n. 2
0
def bootstrapdict():
    source = render_string(
        "devpibootstrap.py",
        INDEXURL="http://localhost:3141/root/dev",
        VIRTUALENVTARURL=
        "http://localhost:3141/root/pypi/virtualenv-1.10.tar.gz",
        DEVPI_INSTALL_INDEX="http://localhost:3141/root/dev",
        TESTSPEC="pytest")
    d = {}
    py.builtin.exec_(py.code.compile(source), d)
    return d
Esempio n. 3
0
def test_main(request, url_of_liveserver, mapp, tmpdir, monkeypatch):
    # not a very good test as it requires going to pypi.python.org
    mapp.login_root()
    mapp.create_index("root/dev")
    tmpdir.chdir()
    source = render_string(
        "devpibootstrap.py",
        INDEXURL=url_of_liveserver + "/root/dev",
        VIRTUALENVTARURL=("https://pypi.python.org/packages/source/"
                          "v/virtualenv/virtualenv-1.10.tar.gz"),
        DEVPI_INSTALL_INDEX=url_of_liveserver + "/root/dev/+simple/",
        TESTSPEC="py")
    d = {}
    py.builtin.exec_(py.code.compile(source), d)
    l = []

    def record(*args, **kwargs):
        l.append(args)

    monkeypatch.setattr(d["Devpi"], "run", record)
    d["main"]()
    assert len(l) == 2
    assert "use" in l[0][1]
    assert "test" in l[1][1]
Esempio n. 4
0
def test_main(request, url_of_liveserver, mapp, tmpdir, monkeypatch):
    # not a very good test as it requires going to pypi.python.org
    mapp.login_root()
    mapp.create_index("root/dev")
    tmpdir.chdir()
    source = render_string(
        "devpibootstrap.py",
        INDEXURL=url_of_liveserver + "/root/dev",
        VIRTUALENVTARURL=("https://pypi.python.org/packages/source/"
                          "v/virtualenv/virtualenv-1.10.tar.gz"),
        DEVPI_INSTALL_INDEX=url_of_liveserver + "/root/dev/+simple/",
        TESTSPEC="py")
    d = {}
    py.builtin.exec_(py.code.compile(source), d)
    l = []

    def record(*args, **kwargs):
        l.append(args)

    monkeypatch.setattr(d["Devpi"], "run", record)
    d["main"]()
    assert len(l) == 2
    assert "use" in l[0][1]
    assert "test" in l[1][1]