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_)
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)