launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #22830
Re: [Merge] lp:~twom/launchpad/git-reviews-link into lp:launchpad
Diff comments:
> === modified file 'lib/lp/code/browser/tests/test_gitlisting.py'
> --- lib/lp/code/browser/tests/test_gitlisting.py 2018-08-20 23:33:01 +0000
> +++ lib/lp/code/browser/tests/test_gitlisting.py 2018-08-22 14:17:30 +0000
> @@ -320,10 +323,28 @@
> def setUp(self):
> super(TestProductGitListingView, self).setUp()
> self.owner = self.factory.makePerson(name="foowner")
> - self.target = self.factory.makeProduct(name="foo", owner=self.owner)
> + self.target = self.factory.makeProduct(name="foo", owner=self.owner,
> + vcs=VCSType.GIT)
> self.target_path = "foo"
> self.branch_target = self.target
>
> + def test_active_reviews_link(self):
> + main_repo = self.factory.makeGitRepository(
> + owner=self.owner, target=self.target, name="foo")
> + git_refs = self.factory.makeGitRefs(
> + main_repo,
> + paths=["refs/heads/master", "refs/heads/1.0", "refs/tags/1.1"])
> +
> + with admin_logged_in():
> + getUtility(IGitRepositorySet).setDefaultRepository(
> + target=self.target, repository=main_repo)
> +
> + self.factory.makeBranchMergeProposalForGit(
> + target_ref=git_refs[0],
> + set_state=BranchMergeProposalStatus.NEEDS_REVIEW)
> + view = create_initialized_view(self.target, '+git')
> + find_tag_by_id(view(), 'active-review-count')
You need a bit more than just calling it, since find_tag_by_id will return None if there's no such element. Can you at least assertIsNotNone?
> +
>
> class TestPersonProductGitListingView(TestPersonTargetGitListingView,
> TestCaseWithFactory):
--
https://code.launchpad.net/~twom/launchpad/git-reviews-link/+merge/353575
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.
References