def test_db_changed_missing_relation_data(self, configs):
     configs.complete_contexts = MagicMock()
     configs.complete_contexts.return_value = []
     relations.db_changed()
     self.juju_log.assert_called_with(
         'shared-db relation incomplete. Peer not ready?'
     )
 def test_db_changed_missing_relation_data(self, configs):
     configs.complete_contexts = MagicMock()
     configs.complete_contexts.return_value = []
     relations.db_changed()
     self.juju_log.assert_called_with(
         'shared-db relation incomplete. Peer not ready?'
     )
 def test_db_changed_missing_relation_data(self, configs):
     self.is_db_maintenance_mode.return_value = False
     self.is_db_initialised.return_value = False
     configs.complete_contexts = MagicMock()
     configs.complete_contexts.return_value = []
     relations.db_changed()
     self.juju_log.assert_called_with(
         'shared-db relation incomplete. Peer not ready?')
 def _shared_db_test(self, configs, unit_name,
                     allowed_units='glance/0 glance/3'):
     self.relation_get.return_value = allowed_units
     self.local_unit.return_value = unit_name
     configs.complete_contexts = MagicMock()
     configs.complete_contexts.return_value = ['shared-db']
     configs.write = MagicMock()
     relations.db_changed()
 def _shared_db_test(self, configs, unit_name,
                     allowed_units='glance/0 glance/3'):
     self.relation_get.return_value = allowed_units
     self.local_unit.return_value = unit_name
     configs.complete_contexts = MagicMock()
     configs.complete_contexts.return_value = ['shared-db']
     configs.write = MagicMock()
     relations.db_changed()
 def _shared_db_test(self, configs):
     configs.complete_contexts = MagicMock()
     configs.complete_contexts.return_value = ['shared-db']
     configs.write = MagicMock()
     relations.db_changed()