~rvb/maas/bug-1384001-redux-2

« back to all changes in this revision

Viewing changes to src/maasserver/testing/tests/test_rabbit.py

  • Committer: Gavin Panella
  • Date: 2014-09-24 13:05:22 UTC
  • mto: This revision was merged to the branch mainline in revision 3125.
  • Revision ID: gavin.panella@canonical.com-20140924130522-evlc19hghh3noquy
Remove lots of RabbitMQ stuff.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright 2012-2014 Canonical Ltd.  This software is licensed under the
2
 
# GNU Affero General Public License version 3 (see the file LICENSE).
3
 
 
4
 
"""Tests for `maastesting.rabbit`."""
5
 
 
6
 
from __future__ import (
7
 
    absolute_import,
8
 
    print_function,
9
 
    unicode_literals,
10
 
    )
11
 
 
12
 
str = None
13
 
 
14
 
__metaclass__ = type
15
 
__all__ = []
16
 
 
17
 
from django.conf import settings
18
 
from maasserver.testing.rabbit import RabbitServerSettings
19
 
from maastesting.factory import factory
20
 
from maastesting.testcase import MAASTestCase
21
 
from rabbitfixture.server import RabbitServerResources
22
 
 
23
 
 
24
 
class TestRabbitServerSettings(MAASTestCase):
25
 
 
26
 
    def test_patch(self):
27
 
        config = RabbitServerResources(
28
 
            hostname=factory.make_string(),
29
 
            port=factory.pick_port(),
30
 
            dist_port=factory.pick_port())
31
 
        self.useFixture(config)
32
 
        self.useFixture(RabbitServerSettings(config))
33
 
        self.assertEqual(
34
 
            "%s:%d" % (config.hostname, config.port),
35
 
            settings.RABBITMQ_HOST)
36
 
        self.assertEqual("guest", settings.RABBITMQ_PASSWORD)
37
 
        self.assertEqual("guest", settings.RABBITMQ_USERID)
38
 
        self.assertEqual("/", settings.RABBITMQ_VIRTUAL_HOST)
39
 
        self.assertTrue(settings.RABBITMQ_PUBLISH)