Exemple #1
0
def setup_module(module):
    packages = 'stevedore', 'virtualenvwrapper', 'pbr', 'novaclient'
    for pkg in packages:
        try:
            __import__(pkg)
            tmpl = "Integration tests cannot run when {pkg} is installed"
            pytest.skip(tmpl.format(**locals()))
        except ImportError:
            pass

    try:
        urlopen('https://pypi.python.org/pypi')
    except Exception as exc:
        pytest.skip(reason=str(exc))
def setup_module(module):
    packages = 'stevedore', 'virtualenvwrapper', 'pbr', 'novaclient'
    for pkg in packages:
        try:
            __import__(pkg)
            tmpl = "Integration tests cannot run when {pkg} is installed"
            pytest.skip(tmpl.format(**locals()))
        except ImportError:
            pass

    try:
        urlopen('https://pypi.python.org/pypi')
    except Exception as exc:
        pytest.skip(str(exc))
def setup_module(module):
    packages = "stevedore", "virtualenvwrapper", "pbr", "novaclient"
    for pkg in packages:
        try:
            __import__(pkg)
            tmpl = "Integration tests cannot run when {pkg} is installed"
            pytest.skip(tmpl.format(**locals()))
        except ImportError:
            pass

    try:
        urlopen("https://pypi.python.org/pypi")
    except Exception as exc:
        pytest.skip(reason=str(exc))
def test_full():
    """virtualenv + pip + buildout"""
    _system_call('virtualenv', '--no-site-packages', '.')
    _system_call('bin/easy_install', '-q', 'setuptools==dev')
    _system_call('bin/easy_install', '-qU', 'setuptools==dev')
    _system_call('bin/easy_install', '-q', 'pip')
    _system_call('bin/pip', 'install', '-q', 'zc.buildout')

    with open('buildout.cfg', 'w') as f:
        f.write(SIMPLE_BUILDOUT)

    with open('bootstrap.py', 'w') as f:
        f.write(urlopen(BOOTSTRAP).read())

    _system_call('bin/python', 'bootstrap.py')
    _system_call('bin/buildout', '-q')
    eggs = os.listdir('eggs')
    eggs.sort()
    assert len(eggs) == 3
    assert eggs[1].startswith('setuptools')
    del eggs[1]
    assert eggs == ['extensions-0.3-py2.6.egg',
        'zc.recipe.egg-1.2.2-py2.6.egg']
def test_full():
    """virtualenv + pip + buildout"""
    _system_call('virtualenv', '--no-site-packages', '.')
    _system_call('bin/easy_install', '-q', 'setuptools==dev')
    _system_call('bin/easy_install', '-qU', 'setuptools==dev')
    _system_call('bin/easy_install', '-q', 'pip')
    _system_call('bin/pip', 'install', '-q', 'zc.buildout')

    with open('buildout.cfg', 'w') as f:
        f.write(SIMPLE_BUILDOUT)

    with open('bootstrap.py', 'w') as f:
        f.write(urlopen(BOOTSTRAP).read())

    _system_call('bin/python', 'bootstrap.py')
    _system_call('bin/buildout', '-q')
    eggs = os.listdir('eggs')
    eggs.sort()
    assert len(eggs) == 3
    assert eggs[1].startswith('setuptools')
    del eggs[1]
    assert eggs == [
        'extensions-0.3-py2.6.egg', 'zc.recipe.egg-1.2.2-py2.6.egg'
    ]