示例#1
0
def test_handle_error(vcs_mock, remote_mock, test_commit_mock):

    def discovery_error(*args):
        raise remote.DiscoveryError
    remote_mock.side_effect = discovery_error

    commit = sentinel.Commit
    runtests.handle(commit)

    eq_(methods(vcs_mock), ['checkout', 'call', 'apply_testing_patch', 'reset'])
示例#2
0
def test_handle(vcs_mock, remote_mock, test_commit_mock):
    commit = sentinel.Commit
    runtests.handle(commit)

    vcs_mock.checkout.assert_called_with(commit)
    vcs_mock.reset.assert_called_with(commit)
    eq_(methods(vcs_mock), ['checkout', 'call', 'reset'])

    assert remote.cases.called
    test_commit_mock.assert_called_with(commit)