예제 #1
0
    def test_get_create_table_sql_unsupported(self):
        ''' Raise an exception if the database type is not supported. '''

        type_ = 'bogusdb'

        with self.assertRaises(ValueError):
            agnostic._get_create_table_sql(type_)
예제 #2
0
    def test_get_create_table_sql(self):
        ''' Generate the SQL for creating a table. '''

        type_ = 'postgres'
        create_table_re = re.compile(r'CREATE TABLE', flags=re.IGNORECASE)

        sql = agnostic._get_create_table_sql(type_)

        self.assertRegex(sql, create_table_re)