~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/soyuz/browser/tests/test_builder.py

  • Committer: Raphael Badin
  • Date: 2012-01-04 16:39:15 UTC
  • mto: This revision was merged to the branch mainline in revision 14654.
  • Revision ID: raphael.badin@canonical.com-20120104163915-googt0xvdw4fy9zm
Precache more data.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright 2010-2011 Canonical Ltd.  This software is licensed under the
 
1
# Copyright 2010-2012 Canonical Ltd.  This software is licensed under the
2
2
# GNU Affero General Public License version 3 (see the file LICENSE).
3
3
 
4
4
"""Tests for the lp.soyuz.browser.builder module."""
5
5
 
6
6
__metaclass__ = type
7
7
 
8
 
from testtools.matchers import LessThan
 
8
from testtools.matchers import Equals
9
9
from zope.component import getUtility
10
10
from zope.security.proxy import removeSecurityProxy
11
11
 
85
85
        recorder1, recorder2 = record_two_runs(
86
86
            builders_homepage_render, create_build, 2)
87
87
 
88
 
        self.assertThat(
89
 
            recorder2,
90
 
            HasQueryCount(LessThan(recorder1.count + 3 * 2 + 1)))
 
88
        self.assertThat(recorder2, HasQueryCount(Equals(recorder1.count)))
91
89
 
92
90
    def test_builders_recipe_build_query_count(self):
93
91
        def create_build():
98
96
        recorder1, recorder2 = record_two_runs(
99
97
            builders_homepage_render, create_build, 2)
100
98
 
101
 
        self.assertThat(
102
 
            recorder2,
103
 
            HasQueryCount(LessThan(recorder1.count + 4 * 2 + 1)))
 
99
        self.assertThat(recorder2, HasQueryCount(Equals(recorder1.count)))
104
100
 
105
101
    def test_builders_translation_template_build_query_count(self):
106
102
        def create_build():
117
113
        recorder1, recorder2 = record_two_runs(
118
114
            builders_homepage_render, create_build, 2)
119
115
 
120
 
        self.assertThat(
121
 
            recorder2,
122
 
            HasQueryCount(LessThan(recorder1.count + 3 * 2 + 1)))
 
116
        self.assertThat(recorder2, HasQueryCount(Equals(recorder1.count)))