当前位置: 首页>>代码示例>>Python>>正文


Python GitUp.run方法代码示例

本文整理汇总了Python中PyGitUp.gitup.GitUp.run方法的典型用法代码示例。如果您正苦于以下问题:Python GitUp.run方法的具体用法?Python GitUp.run怎么用?Python GitUp.run使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PyGitUp.gitup.GitUp的用法示例。


在下文中一共展示了GitUp.run方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_submodules

# 需要导入模块: from PyGitUp.gitup import GitUp [as 别名]
# 或者: from PyGitUp.gitup.GitUp import run [as 别名]
def test_submodules():
    """ Run 'git up' with submodules """
    repo = Repo(repo_path)
    repo_head = repo.head.commit.hexsha
    submod_head = repo.submodules[0].hexsha

    os.chdir(join(repo_path, 'sub'))

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

    # PyGitUp uses the submodule instead of the toplevel git repo
    assert_equal(submod_head, gitup.git.repo.head.commit.hexsha)

    gitup.run()

    repo = Repo(repo_path)

    assert_equal(len(gitup.states), 1)
    assert_equal(gitup.states[0], 'fast-forwarding')

    # Repo itself is unchanged:
    assert_equal(repo.head.commit.hexsha, repo_head)
    # Submodule is changed:
    assert_not_equal(gitup.git.repo.head.commit.hexsha, submod_head)
开发者ID:msiemens,项目名称:PyGitUp,代码行数:27,代码来源:test_submodules.py

示例2: test_rebase_error

# 需要导入模块: from PyGitUp.gitup import GitUp [as 别名]
# 或者: from PyGitUp.gitup.GitUp import run [as 别名]
def test_rebase_error():
    """ Run 'git up' with a failing rebase """
    os.chdir(repo_path)

    from PyGitUp.gitup import GitUp
    gitup = GitUp(testing=True)
    gitup.run()
开发者ID:dragon788,项目名称:PyGitUp,代码行数:9,代码来源:test_rebase_error.py

示例3: test_detached

# 需要导入模块: from PyGitUp.gitup import GitUp [as 别名]
# 或者: from PyGitUp.gitup.GitUp import run [as 别名]
def test_detached():
    """ Run 'git up' with detached head """
    os.chdir(repo_path)

    from PyGitUp.gitup import GitUp
    gitup = GitUp(testing=True)
    gitup.run()
开发者ID:msiemens,项目名称:PyGitUp,代码行数:9,代码来源:test_detached.py

示例4: test_fetch_fail

# 需要导入模块: from PyGitUp.gitup import GitUp [as 别名]
# 或者: from PyGitUp.gitup.GitUp import run [as 别名]
def test_fetch_fail():
    """ Run 'git up' with a non-existent remote """
    os.chdir(repo_path)

    from PyGitUp.gitup import GitUp
    gitup = GitUp(testing=True)
    gitup.run()
开发者ID:msiemens,项目名称:PyGitUp,代码行数:9,代码来源:test_fetch_fail.py

示例5: test_stash_error

# 需要导入模块: from PyGitUp.gitup import GitUp [as 别名]
# 或者: from PyGitUp.gitup.GitUp import run [as 别名]
def test_stash_error():
    """ Run 'git up' with an error while stashing """
    os.chdir(repo_path)

    from PyGitUp.gitup import GitUp
    gitup = GitUp(testing=True)
    gitup.run()
开发者ID:msiemens,项目名称:PyGitUp,代码行数:9,代码来源:test_stash_error.py

示例6: test_unstash_error

# 需要导入模块: from PyGitUp.gitup import GitUp [as 别名]
# 或者: from PyGitUp.gitup.GitUp import run [as 别名]
def test_unstash_error():
    """ Run 'git up' with an unclean unstash """
    os.chdir(repo_path)

    from PyGitUp.gitup import GitUp
    gitup = GitUp(testing=True)
    gitup.run()
开发者ID:Dipsomaniac,项目名称:PyGitUp,代码行数:9,代码来源:test_unstash_error.py

示例7: test_checkout_error

# 需要导入模块: from PyGitUp.gitup import GitUp [as 别名]
# 或者: from PyGitUp.gitup.GitUp import run [as 别名]
def test_checkout_error():
    """ Run 'git up' with checkout errors """
    os.chdir(repo_path)

    from PyGitUp.gitup import GitUp
    gitup = GitUp(testing=True)
    gitup.run()
开发者ID:Dipsomaniac,项目名称:PyGitUp,代码行数:9,代码来源:test_checkout_error.py

示例8: test_bundler

# 需要导入模块: from PyGitUp.gitup import GitUp [as 别名]
# 或者: from PyGitUp.gitup.GitUp import run [as 别名]
def test_bundler():
    """ Run bundler integration """
    shell = True if platform.system() == 'Windows' else False

    if os.environ.get('TRAVIS', False):
        raise SkipTest('Skip this test on Travis CI :(')

    # Helper methods
    def is_installed(prog):
        dev_null = open(os.devnull, 'wb')
        try:
            return_value = subprocess.call([prog, '--version'], shell=shell,
                                           stdout=dev_null, stderr=dev_null)
            return return_value == 0
        except OSError:
            return False

    def get_output(cmd):
        return str(subprocess.check_output(cmd, shell=shell))

    # Check for ruby and bundler
    if not (is_installed('ruby') and is_installed('gem')
            and 'bundler' in get_output(['gem', 'list'])):

        # Ruby not installed, skip test
        raise SkipTest('Ruby not installed, skipped Bundler integration test')

    os.chdir(repo_path)

    from PyGitUp.gitup import GitUp
    gitup = GitUp(testing=True)
    gitup.run()
开发者ID:Javex,项目名称:PyGitUp,代码行数:34,代码来源:test_bundler.py

示例9: test_fast_forwarded

# 需要导入模块: from PyGitUp.gitup import GitUp [as 别名]
# 或者: from PyGitUp.gitup.GitUp import run [as 别名]
def test_fast_forwarded():
    """ Fail correctly when a rebase would overwrite untracked files """
    os.chdir(repo_path)

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

    gitup.run()
开发者ID:msiemens,项目名称:PyGitUp,代码行数:10,代码来源:test_overwrite_untracked_error.py

示例10: test_out_of_tree

# 需要导入模块: from PyGitUp.gitup import GitUp [as 别名]
# 或者: from PyGitUp.gitup.GitUp import run [as 别名]
def test_out_of_tree():
    """ Run 'git up' with an out-of-tree source """
    os.chdir(work_tree)

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

    assert_equal(gitup.states, ['fast-forwarding'])
开发者ID:dragon788,项目名称:PyGitUp,代码行数:11,代码来源:test_out_of_tree.py

示例11: test_fast_forwarded

# 需要导入模块: from PyGitUp.gitup import GitUp [as 别名]
# 或者: from PyGitUp.gitup.GitUp import run [as 别名]
def test_fast_forwarded():
    """ Run 'git up' with result: fast-forwarding """
    os.chdir(repo_path)

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

    assert_equal(len(gitup.states), 1)
    assert_equal(gitup.states[0], 'fast-forwarding')
开发者ID:msiemens,项目名称:PyGitUp,代码行数:12,代码来源:test_fast_forwarded.py

示例12: test_remote_branch_deleted

# 需要导入模块: from PyGitUp.gitup import GitUp [as 别名]
# 或者: from PyGitUp.gitup.GitUp import run [as 别名]
def test_remote_branch_deleted():
    """ Run 'git up' with remotely deleted branch """
    os.chdir(repo_path)

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

    assert_equal(len(gitup.states), 2)
    assert_equal(gitup.states[1], 'remote branch doesn\'t exist')
开发者ID:msiemens,项目名称:PyGitUp,代码行数:12,代码来源:test_remote_branch_deleted.py

示例13: test_ahead_of_upstream

# 需要导入模块: from PyGitUp.gitup import GitUp [as 别名]
# 或者: from PyGitUp.gitup.GitUp import run [as 别名]
def test_ahead_of_upstream():
    """ Run 'git up' with result: ahead of upstream """
    os.chdir(repo_path)

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

    assert_equal(len(gitup.states), 1)
    assert_equal(gitup.states[0], 'ahead')
开发者ID:Dipsomaniac,项目名称:PyGitUp,代码行数:12,代码来源:test_ahead_of_upstream.py

示例14: test_issue_55

# 需要导入模块: from PyGitUp.gitup import GitUp [as 别名]
# 或者: from PyGitUp.gitup.GitUp import run [as 别名]
def test_issue_55():
    """ Regression test for #55 """
    os.chdir(repo_path)

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

    assert_equal(len(gitup.states), 1)
    assert_equal(gitup.states[0], 'fast-forwarding')
开发者ID:msiemens,项目名称:PyGitUp,代码行数:12,代码来源:test_issue_55.py

示例15: test_rebase_arguments

# 需要导入模块: from PyGitUp.gitup import GitUp [as 别名]
# 或者: from PyGitUp.gitup.GitUp import run [as 别名]
def test_rebase_arguments():
    """ Run 'git up' with rebasing.arguments """
    os.chdir(repo_path)

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

    assert_equal(len(gitup.states), 1)
    assert_equal(gitup.states[0], 'rebasing')
开发者ID:msiemens,项目名称:PyGitUp,代码行数:12,代码来源:test_rebase_arguments.py


注:本文中的PyGitUp.gitup.GitUp.run方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。