~gnuoy/charms/trusty/quantum-gateway/neutron-refactor

« back to all changes in this revision

Viewing changes to unit_tests/test_quantum_hooks.py

  • Committer: Adam Gandelman
  • Date: 2013-11-06 04:37:09 UTC
  • mfrom: (36.2.6 quantum-gateway)
  • Revision ID: adamg@canonical.com-20131106043709-swoywt4nj6k1hq8y
[jamespage] Switch to using common vhost for all openstack services

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
    'CONFIGS',
27
27
    'configure_ovs',
28
28
    'relation_set',
 
29
    'relation_ids',
29
30
    'unit_get',
30
31
    'relation_get',
31
32
    'install_ca_cert',
99
100
    def test_upgrade_charm(self):
100
101
        _install = self.patch('install')
101
102
        _config_changed = self.patch('config_changed')
 
103
        _amqp_joined = self.patch('amqp_joined')
 
104
        self.relation_ids.return_value = ['amqp:0']
102
105
        self._call_hook('upgrade-charm')
103
 
        _install.assert_called()
104
 
        _config_changed.assert_called()
 
106
        self.assertTrue(_install.called)
 
107
        self.assertTrue(_config_changed.called)
 
108
        _amqp_joined.assert_called_with(relation_id='amqp:0')
105
109
 
106
110
    def test_db_joined(self):
107
111
        self.unit_get.return_value = 'myhostname'
118
122
    def test_amqp_joined(self):
119
123
        self._call_hook('amqp-relation-joined')
120
124
        self.relation_set.assert_called_with(
121
 
            username='nova',
122
 
            vhost='nova',
 
125
            username='neutron',
 
126
            vhost='openstack',
 
127
            relation_id=None
123
128
        )
124
129
 
125
130
    def test_amqp_changed(self):