def test_backfill_first_call(self, vcs_mock, process_mock, revision_mock): mock_query = Mock() mock_query.first.return_value = None revision_mock.q.order_by.return_value = mock_query vcs_mock.repo.commits.return_value = [sentinel.Commit] runtests.backfill() generator = process_mock.call_args[0][0] assert generator.next() == sentinel.Commit
def test_backfill(self, vcs_mock, process_mock): vcs_mock.before.return_value = sentinel.Before runtests.backfill() vcs_mock.before.assert_called_with('1' * 40) generator = process_mock.call_args[0][0] assert generator.next() == sentinel.Before vcs_mock.before.return_value = sentinel.Before2 assert generator.next() == sentinel.Before2