Exemplo n.º 1
0
 def test_new_line(self):
     val = '(my_column,\nmy_another_column) [unique]'
     with self.assertRaises(ParseException):
         composite_index_syntax.parseString(val, parseAll=True)
     val2 = '(my_column, my_another_column)\n[unique]'
     with self.assertRaises(ParseException):
         composite_index_syntax.parseString(val2, parseAll=True)
Exemplo n.º 2
0
 def test_settings(self):
     val = '(my_column, my_another_column) [unique]'
     res = composite_index_syntax.parseString(val, parseAll=True)
     self.assertIn('my_column', list(res['subject']))
     self.assertIn('my_another_column', list(res['subject']))
     self.assertEqual(len(res['subject']), 2)
     self.assertTrue(res['settings']['unique'])
Exemplo n.º 3
0
 def test_no_settings(self) -> None:
     val = '(my_column, my_another_column)'
     res = composite_index_syntax.parseString(val, parseAll=True)
     self.assertIn('my_column', list(res['subject']))
     self.assertIn('my_another_column', list(res['subject']))
     self.assertEqual(len(res['subject']), 2)