← Back to team overview

launchpad-reviewers team mailing list archive

Re: [Merge] lp:~twom/launchpad/git-reviews-link into lp:launchpad

 

Review: Approve



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:00:32 +0000
> @@ -320,10 +322,29 @@
>      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
> +        )

LP style is to indent trailing parens/brackets/braces.  (Slightly weird IMO, but there you go.)  Though in this case I'd just put it on the preceding line.

> +        view = create_initialized_view(self.target, '+git')
> +        self.assertIn('active review', view())

Purely-textual assertions like this are prone to false positives.  Could you do something based on `find_tag_by_id(view(), 'active-review-count')` instead?

> +
>  
>  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