~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/buildmaster/tests/test_webservice.py

  • Committer: Francis J. Lacoste
  • Date: 2011-07-07 19:42:00 UTC
  • mto: This revision was merged to the branch mainline in revision 13501.
  • Revision ID: francis.lacoste@canonical.com-20110707194200-sv93ur440pjdj4oe
Export getBuildQueueSizes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright 2011 Canonical Ltd.  This software is licensed under the
 
2
# GNU Affero General Public License version 3 (see the file LICENSE).
 
3
 
 
4
"""Tests for the builders webservice ."""
 
5
 
 
6
__metaclass__ = type
 
7
 
 
8
from canonical.testing.layers import DatabaseFunctionalLayer
 
9
from canonical.launchpad.testing.pages import LaunchpadWebServiceCaller
 
10
from lp.testing import (
 
11
    logout,
 
12
    TestCaseWithFactory,
 
13
    )
 
14
 
 
15
 
 
16
class TestBuildersCollection(TestCaseWithFactory):
 
17
    layer = DatabaseFunctionalLayer
 
18
 
 
19
    def setUp(self):
 
20
        super(TestBuildersCollection, self).setUp()
 
21
        self.webservice = LaunchpadWebServiceCaller()
 
22
        # webservice doesn't like dangling interactions.
 
23
        logout()
 
24
 
 
25
    def test_getBuildQueueSizes(self):
 
26
        results = self.webservice.named_get(
 
27
            '/builders', 'getBuildQueueSizes', api_version='devel')
 
28
        self.assertEquals(
 
29
            ['nonvirt', 'virt'], sorted(results.jsonBody().keys()))
 
30
 
 
31