def test_parse_custom_application_nested(self): # {outer # {inner [$ +]} # [$ inner]} tokens = ['{', 'outer', '{', 'inner', '[', '$', '+', ']', '}', '[', '$', 'inner', ']', '}'] with self.assertRaises(errors.UnbalancedBracketsError): parser.parse(tokens)
def test_parse_custom_application_nested(self): # {outer # {inner [$ +]} # [$ inner]} tokens = [ '{', 'outer', '{', 'inner', '[', '$', '+', ']', '}', '[', '$', 'inner', ']', '}' ] with self.assertRaises(errors.UnbalancedBracketsError): parser.parse(tokens)
def test_parse_custom_application_starts_with_num(self): # {1 [$ +]} tokens = ['{', '1', '[', '$', '+', ']', '}'] with self.assertRaises(errors.ApplicationNameError): parser.parse(tokens)
def test_parse_custom_application_named_main(self): # {main [$ +]} tokens = ['{', 'main', '[', '$', '+', ']', '}'] with self.assertRaises(errors.ApplicationNameError): parser.parse(tokens)
def tearDown(self): actual = parser.parse(self.tokens) self.assertDictEqual(actual, self.expected)