Exemplo n.º 1
0
def test_fetchall():
    """ Run 'git up' with fetch.all """
    os.chdir(repo_path)

    from PyGitUp.gitup import GitUp
    gitup = GitUp(testing=True)

    with capture() as [stdout, _]:
        gitup.run()

    stdout = stdout.getvalue()

    assert_true('origin' in stdout)
    assert_true(test_name in stdout)
Exemplo n.º 2
0
def test_no_fetch():
    """ Run 'git up' with '--no-fetch' argument """
    os.chdir(repo_path)

    from PyGitUp.gitup import GitUp
    gitup = GitUp(testing=True)
    gitup.should_fetch = False

    with capture() as [stdout, _]:
        gitup.run()

    stdout = stdout.getvalue()

    assert_false('Fetching' in stdout)

    assert_true('rebasing' in stdout)
    assert_true('up to date' in stdout)
    assert_true(test_name in stdout)
    assert_true(new_branch_name in stdout)
Exemplo n.º 3
0
def test_no_fetch():
    """ Run 'git up' with '--no-fetch' argument """
    os.chdir(repo_path)

    from PyGitUp.gitup import GitUp
    gitup = GitUp(testing=True)
    gitup.should_fetch = False

    with capture() as [stdout, _]:
        gitup.run()

    stdout = stdout.getvalue()

    assert 'Fetching' not in stdout

    assert 'rebasing' in stdout
    assert 'up to date' in stdout
    assert test_name in stdout
    assert new_branch_name in stdout
Exemplo n.º 4
0
def test_version():
    """ Run 'git up': Check version """
    try:
        import pkg_resources as pkg
    except ImportError:
        raise SkipTest('pip not installed')

    try:
        socket.gethostbyname('pypi.python.org')
    except socket.error:
        raise SkipTest('Can\'t connect to PYPI')

    from PyGitUp.gitup import GitUp
    with capture() as [stdout, _]:
        GitUp(sparse=True).version_info()
    stdout = stdout.getvalue()

    package = pkg.get_distribution('git-up')
    local_version_str = package.version

    assert_in(local_version_str, stdout)