Пример #1
0
 def test_settings(self):
     val = 'my_column [unique]'
     res = single_index_syntax.parseString(val, parseAll=True)
     self.assertEqual(res['subject'], 'my_column')
     self.assertTrue(res['settings']['unique'])
Пример #2
0
 def test_settings_on_new_line(self):
     val = 'my_column\n[unique]'
     with self.assertRaises(ParseException):
         single_index_syntax.parseString(val, parseAll=True)
Пример #3
0
 def test_no_settings(self):
     val = 'my_column'
     res = single_index_syntax.parseString(val, parseAll=True)
     self.assertEqual(res['subject'], val)