742
743
proposals = self.all_branches.getMergeProposals()
743
744
self.assertEqual([], list(proposals))
746
def test_empty_branches_shortcut(self):
747
# If you explicitly pass an empty collection of branches,
748
# the method shortcuts and gives you an empty result set. In this
749
# way, for_branches=None (the default) has a very different behavior
750
# than for_branches=[]: the first is no restriction, while the second
751
# excludes everything.
752
mp = self.factory.makeBranchMergeProposal()
753
proposals = self.all_branches.getMergeProposals(for_branches=[])
754
self.assertEqual([], list(proposals))
755
self.assertIsInstance(proposals, EmptyResultSet)
757
def test_empty_revisions_shortcut(self):
758
# If you explicitly pass an empty collection of revision numbers,
759
# the method shortcuts and gives you an empty result set. In this
760
# way, merged_revnos=None (the default) has a very different behavior
761
# than merged_revnos=[]: the first is no restriction, while the second
762
# excludes everything.
763
mp = self.factory.makeBranchMergeProposal()
764
proposals = self.all_branches.getMergeProposals(merged_revnos=[])
765
self.assertEqual([], list(proposals))
766
self.assertIsInstance(proposals, EmptyResultSet)
745
768
def test_some_branch_merge_proposals(self):
746
769
mp = self.factory.makeBranchMergeProposal()
747
770
proposals = self.all_branches.getMergeProposals()