~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/bugs/model/tests/test_bugsubscriptioninfo.py

  • Committer: Gavin Panella
  • Date: 2012-01-04 17:10:59 UTC
  • mto: This revision was merged to the branch mainline in revision 14638.
  • Revision ID: gavin.panella@canonical.com-20120104171059-hu3moj01ntw0wrb3
Add docstrings to exercise_subscription_set() and exercise_subscription_set_sorted_first().

Show diffs side-by-side

added added

removed removed

Lines of Context:
560
560
        self.assertThat(recorder, condition)
561
561
 
562
562
    def exercise_subscription_set(self, set_name, counts=(1, 1, 0)):
 
563
        """Test the number of queries it takes to inspect a subscription set.
 
564
 
 
565
        :param set_name: The name of the set, e.g. "direct_subscriptions".
 
566
        :param counts: A triple of the expected query counts for each of three
 
567
            operations: get the set, get the set's subscribers, get the set's
 
568
            subscribers in order.
 
569
        """
563
570
        # Looking up subscriptions takes a single query.
564
571
        with self.exactly_x_queries(counts[0]):
565
572
            getattr(self.info, set_name)
573
580
 
574
581
    def exercise_subscription_set_sorted_first(
575
582
        self, set_name, counts=(1, 1, 0)):
 
583
        """Test the number of queries it takes to inspect a subscription set.
 
584
 
 
585
        This differs from `exercise_subscription_set` in its second step, when
 
586
        it looks at the sorted subscription list instead of the subscriber
 
587
        set.
 
588
 
 
589
        :param set_name: The name of the set, e.g. "direct_subscriptions".
 
590
        :param counts: A triple of the expected query counts for each of three
 
591
            operations: get the set, get the set in order, get the set's
 
592
            subscribers in order.
 
593
        """
576
594
        # Looking up subscriptions takes a single query.
577
595
        with self.exactly_x_queries(counts[0]):
578
596
            getattr(self.info, set_name)