コード例 #1
0
ファイル: test_remote_core.py プロジェクト: ZeitOnline/batou
def test_update_code_new_target(mock_remote_core, tmpdir):
    remote_core.cmd.side_effect = [('', ''), ('', ''), ('', ''), ('', '')]
    remote_core.ensure_repository(str(tmpdir) + '/foo', 'hg-bundle')
    remote_core.hg_pull_code('http://bitbucket.org/flyingcircus/batou')
    remote_core.hg_update_working_copy('default')

    assert remote_core.cmd.call_count == 4
    calls = iter(x[1][0] for x in remote_core.cmd.mock_calls)
    assert next(calls) == 'hg init {}'.format(remote_core.target_directory)
    assert next(calls) == 'hg pull http://bitbucket.org/flyingcircus/batou'
    assert next(calls) == 'hg up -C default'
    assert next(calls) == 'hg id -i'
コード例 #2
0
ファイル: test_remote_core.py プロジェクト: wosc/batou
def test_update_code_new_target(mock_remote_core, tmpdir):
    remote_core.cmd.side_effect = [("", ""), ("", ""), ("", ""), ("", "")]
    remote_core.ensure_repository(str(tmpdir) + "/foo", "hg-bundle")
    remote_core.hg_pull_code("http://bitbucket.org/flyingcircus/batou")
    remote_core.hg_update_working_copy("default")

    assert remote_core.cmd.call_count == 4
    calls = iter(x[1][0] for x in remote_core.cmd.mock_calls)
    assert next(calls) == "hg init {}".format(remote_core.target_directory)
    assert next(calls) == "hg pull http://bitbucket.org/flyingcircus/batou"
    assert next(calls) == "hg up -C default"
    assert next(calls) == "hg id -i"
コード例 #3
0
ファイル: test_remote_core.py プロジェクト: ZeitOnline/batou
def test_update_code_existing_target(mock_remote_core, tmpdir):
    remote_core.cmd.side_effect = [('', ''), ('', ''), ('', ''), ('', '')]

    remote_core.ensure_repository(str(tmpdir), 'hg-pull')
    remote_core.hg_pull_code('http://bitbucket.org/flyingcircus/batou')
    remote_core.hg_update_working_copy('default')

    calls = iter(x[1][0] for x in remote_core.cmd.mock_calls)
    assert next(calls).startswith('hg init /')
    assert next(calls) == 'hg pull http://bitbucket.org/flyingcircus/batou'
    assert next(calls) == 'hg up -C default'
    assert next(calls) == 'hg id -i'
    assert remote_core.cmd.call_count == 4
コード例 #4
0
ファイル: test_remote_core.py プロジェクト: wosc/batou
def test_update_code_existing_target(mock_remote_core, tmpdir):
    remote_core.cmd.side_effect = [("", ""), ("", ""), ("", ""), ("", "")]

    remote_core.ensure_repository(str(tmpdir), "hg-pull")
    remote_core.hg_pull_code("http://bitbucket.org/flyingcircus/batou")
    remote_core.hg_update_working_copy("default")

    calls = iter(x[1][0] for x in remote_core.cmd.mock_calls)
    assert next(calls).startswith("hg init /")
    assert next(calls) == "hg pull http://bitbucket.org/flyingcircus/batou"
    assert next(calls) == "hg up -C default"
    assert next(calls) == "hg id -i"
    assert remote_core.cmd.call_count == 4