Source

glas_process / testing / test_scmprocdir.py

Full commit
import py
import pytest

import socket
import gevent
from glas_process.scm import ScmProc
try:
    socket.gethostbyname('bitbucket.org')
    net = True
except socket.gaierror:
    net = False

paths = [
    py.path.local(__file__).dirpath().dirpath().strpath,
    'http://bitbucket.org/RonnyPfannschmidt/hgdistver',
]


@pytest.mark.no_create
@pytest.mark.parametrize('path', paths,)
def test_simple_clone(procdir, path):
    if str(path).startswith('http') and not net:
        pytest.xfail('no net')
    assert not procdir.path.check()
    scminfo = dict(
        repo=path,
        branch=None,
    )
    p = ScmProc(procdir, scminfo)
    p.create_or_pull()
    gevent.sleep(0)
    assert procdir.path.check()
    p.create_or_pull()

    p.update_wd()