Exemple #1
0
 def test_parse_custom_application_nested(self):
     # {outer
     #   {inner [$ +]}
     # [$ inner]}
     tokens = ['{', 'outer',
                   '{', 'inner', '[', '$', '+', ']', '}',
               '[', '$', 'inner', ']', '}']
     with self.assertRaises(errors.UnbalancedBracketsError):
         parser.parse(tokens)
Exemple #2
0
 def test_parse_custom_application_nested(self):
     # {outer
     #   {inner [$ +]}
     # [$ inner]}
     tokens = [
         '{', 'outer', '{', 'inner', '[', '$', '+', ']', '}', '[', '$',
         'inner', ']', '}'
     ]
     with self.assertRaises(errors.UnbalancedBracketsError):
         parser.parse(tokens)
Exemple #3
0
 def test_parse_custom_application_starts_with_num(self):
     # {1 [$ +]}
     tokens = ['{', '1', '[', '$', '+', ']', '}']
     with self.assertRaises(errors.ApplicationNameError):
         parser.parse(tokens)
Exemple #4
0
 def test_parse_custom_application_named_main(self):
     # {main [$ +]}
     tokens = ['{', 'main', '[', '$', '+', ']', '}']
     with self.assertRaises(errors.ApplicationNameError):
         parser.parse(tokens)
Exemple #5
0
 def tearDown(self):
     actual = parser.parse(self.tokens)
     self.assertDictEqual(actual, self.expected)
Exemple #6
0
 def test_parse_custom_application_starts_with_num(self):
     # {1 [$ +]}
     tokens = ['{', '1', '[', '$', '+', ']', '}']
     with self.assertRaises(errors.ApplicationNameError):
         parser.parse(tokens)
Exemple #7
0
 def test_parse_custom_application_named_main(self):
     # {main [$ +]}
     tokens = ['{', 'main', '[', '$', '+', ']', '}']
     with self.assertRaises(errors.ApplicationNameError):
         parser.parse(tokens)
Exemple #8
0
 def tearDown(self):
     actual = parser.parse(self.tokens)
     self.assertDictEqual(actual, self.expected)