Esempio n. 1
0
 def test_db_joined(self):
     self.unit_get.return_value = 'heat.foohost.com'
     relations.db_joined()
     self.relation_set.assert_called_with(heat_database='heat',
                                          heat_username='******',
                                          heat_hostname='heat.foohost.com')
     self.unit_get.assert_called_with('private-address')
 def test_db_joined_with_ipv6(self):
     'It properly requests access to a shared-db service'
     self.sync_db_with_multi_ipv6_addresses.return_value = MagicMock()
     self.test_config.set('prefer-ipv6', True)
     relations.db_joined()
     self.sync_db_with_multi_ipv6_addresses.assert_called_with(
         'heat', 'heat', relation_prefix='heat')
 def test_db_joined(self):
     self.get_relation_ip.return_value = '192.168.20.1'
     relations.db_joined()
     self.relation_set.assert_called_with(heat_database='heat',
                                          heat_username='******',
                                          heat_hostname='192.168.20.1')
     self.assertTrue(self.get_relation_ip.called)
Esempio n. 4
0
 def test_db_joined(self):
     self.unit_get.return_value = 'heat.foohost.com'
     relations.db_joined()
     self.relation_set.assert_called_with(database='heat',
                                          username='******',
                                          hostname='heat.foohost.com')
     self.unit_get.assert_called_with('private-address')
Esempio n. 5
0
 def test_db_joined_with_ipv6(self):
     'It properly requests access to a shared-db service'
     self.unit_get.return_value = 'heatnode1'
     self.sync_db_with_multi_ipv6_addresses.return_value = MagicMock()
     self.test_config.set('prefer-ipv6', True)
     relations.db_joined()
     self.sync_db_with_multi_ipv6_addresses.assert_called_with(
         'heat', 'heat', relation_prefix='heat')
Esempio n. 6
0
 def test_db_joined_spaces(self):
     self.network_get_primary_address.side_effect = None
     self.network_get_primary_address.return_value = '192.168.20.1'
     self.unit_get.return_value = 'heat.foohost.com'
     relations.db_joined()
     self.relation_set.assert_called_with(heat_database='heat',
                                          heat_username='******',
                                          heat_hostname='192.168.20.1')
     self.assertFalse(self.unit_get.called)