~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/testing/fixture.py

  • Committer: Jelmer Vernooij
  • Date: 2011-09-21 14:28:02 UTC
  • mfrom: (14006 devel)
  • mto: This revision was merged to the branch mainline in revision 14010.
  • Revision ID: jelmer@canonical.com-20110921142802-7ggkc204igsy532w
MergeĀ lp:launchpad

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 
6
6
__metaclass__ = type
7
7
__all__ = [
8
 
    'RabbitServer',
9
8
    'ZopeAdapterFixture',
10
9
    'ZopeEventHandlerFixture',
11
10
    'ZopeViewReplacementFixture',
13
12
 
14
13
from ConfigParser import SafeConfigParser
15
14
import os.path
16
 
from textwrap import dedent
17
15
 
18
16
from fixtures import (
19
17
    EnvironmentVariableFixture,
20
18
    Fixture,
21
19
    )
22
20
import pgbouncer.fixture
23
 
import rabbitfixture.server
24
21
from zope.component import (
25
22
    getGlobalSiteManager,
26
23
    provideHandler,
36
33
from canonical.config import config
37
34
 
38
35
 
39
 
class RabbitServer(rabbitfixture.server.RabbitServer):
40
 
    """A RabbitMQ server fixture with Launchpad-specific config.
41
 
 
42
 
    :ivar service_config: A snippet of .ini that describes the `rabbitmq`
43
 
        configuration.
44
 
    """
45
 
 
46
 
    def setUp(self):
47
 
        super(RabbitServer, self).setUp()
48
 
        self.config.service_config = dedent("""\
49
 
            [rabbitmq]
50
 
            host: localhost:%d
51
 
            userid: guest
52
 
            password: guest
53
 
            virtual_host: /
54
 
            """ % self.config.port)
55
 
 
56
 
 
57
36
class PGBouncerFixture(pgbouncer.fixture.PGBouncerFixture):
58
37
    """Inserts a controllable pgbouncer instance in front of PostgreSQL.
59
38