~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/services/txlongpoll/server.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-09-30 16:01:42 UTC
  • mfrom: (14032.1.16 longpoll-uri-request)
  • Revision ID: launchpad@pqm.canonical.com-20110930160142-iblt8kfp11iqkwsa
[r=allenap][no-qa] Populate cache.objects[longpoll][api] with
        config.txlongpoll.uri

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
"""TxLongPoll server fixture."""
 
5
 
 
6
__metaclass__ = type
 
7
__all__ = [
 
8
    'TxLongPollServer',
 
9
    ]
 
10
 
 
11
from textwrap import dedent
 
12
 
 
13
from txlongpollfixture.server import TxLongPollFixture
 
14
 
 
15
 
 
16
class TxLongPollServer(TxLongPollFixture):
 
17
    """A TxLongPoll server fixture with Launchpad-specific config.
 
18
 
 
19
    :ivar service_config: A snippet of .ini that describes the `txlongpoll`
 
20
        configuration.
 
21
    """
 
22
 
 
23
    def setUp(self):
 
24
        super(TxLongPollServer, self).setUp()
 
25
        setattr(
 
26
            self, 'service_config',
 
27
            dedent("""\
 
28
                [txlongpoll]
 
29
                frontend_port: %d
 
30
                """ % (
 
31
                    self.config.frontend_port)))