Пример #1
0
 def test_table_and_alias_quotes_alias(self):
     actual_input = '"table_name" "alias"'
     table_name = TableName(actual_input)
     response = table_name.check_validity()
     self.assertEquals(response, Response.okay())
     self.assertEquals(table_name.table, '"table_name"')
     self.assertEquals(table_name.alias, '"alias"')
Пример #2
0
 def test_schema_table_spaces_quotes(self):
     actual_input = '"schema"."table name"'
     table_name = TableName(actual_input)
     response = table_name.check_validity()
     self.assertEquals(response, Response.okay())
     self.assertEquals(table_name.schema, '"schema"')
     self.assertEquals(table_name.table, '"table name"')
Пример #3
0
 def test_and_table_no_quotes_alias(self):
     actual_input = 'table_name alias'
     table_name = TableName(actual_input)
     response = table_name.check_validity()
     self.assertEquals(response, Response.okay())
     self.assertEquals(table_name.table, 'table_name')
     self.assertEquals(table_name.alias, 'alias')
Пример #4
0
 def test_schema_and_table_no_quotes(self):
     actual_input = 'schema.table_name'
     table_name = TableName(actual_input)
     response = table_name.check_validity()
     self.assertEquals(response, Response.okay())
     self.assertEquals(table_name.schema, 'schema')
     self.assertEquals(table_name.table, 'table_name')
Пример #5
0
 def test_table_alias_spaces_no_quotes(self):
     actual_input = 'table name alias'
     table_name = TableName(actual_input)
     response = table_name.check_validity()
     self.assertEquals(response,
                       Response('Table Name has spaces without quotes', 1))
Пример #6
0
 def test_too_many_periods_without_quotes(self):
     actual_input = 'sch.ema.table_name'
     table_name = TableName(actual_input)
     response = table_name.check_validity()
     self.assertEquals(response,
                       Response('Schema Name has period without quotes', 1))
Пример #7
0
 def test_space_after_period(self):
     actual_input = 'schema. table_name'
     table_name = TableName(actual_input)
     response = table_name.check_validity()
     self.assertEquals(response, Response('Failed to parse Table Name', 1))