def test_postgresql_nova_joined_with_db(self):
        self.is_relation_made.return_value = True

        with self.assertRaises(Exception) as context:
            hooks.pgsql_nova_db_joined()
        self.assertEqual(context.exception.message,
                         'Attempting to associate a postgresql database when'
                         ' there is already associated a mysql one')
    def test_postgresql_nova_joined_with_db(self):
        self.is_relation_made.return_value = True

        with self.assertRaises(Exception) as context:
            hooks.pgsql_nova_db_joined()
        self.assertEqual(context.exception.message,
                         'Attempting to associate a postgresql database when'
                         ' there is already associated a mysql one')
Ejemplo n.º 3
0
 def test_postgresql_nova_db_joined(self):
     self.is_relation_made.return_value = False
     hooks.pgsql_nova_db_joined()
     self.relation_set.assert_called_with(database='nova')
 def test_postgresql_nova_db_joined(self):
     self.is_relation_made.return_value = False
     hooks.pgsql_nova_db_joined()
     self.relation_set.assert_called_with(database='nova')