コード例 #1
0
    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')
コード例 #2
0
    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')
コード例 #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')
コード例 #4
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')