def test_message_with_missing_lbrace_raises_exception_with_correct_message(self): s = "message MissingLBrace required int32 i = 1; optional int32 j = 2;}" parser = Parser() try: parser.parse(s) except Exception as e: self.assertEqual("missing opening paren at pos 25: 'required i'", str(e))
def test_enum_with_missing_lbrace_raises_exception_with_correct_message(self): s = "enum MissingLBrace NO = 0; YES = 1;}" parser = Parser() try: parser.parse(s) except Exception as e: self.assertEqual("missing opening paren at pos 22: 'NO = 0; '", str(e))
def test_message_with_missing_lbrace_raises_exception_with_correct_message( self): s = "message MissingLBrace required int32 i = 1; optional int32 j = 2;}" parser = Parser() try: parser.parse(s) except Exception as e: self.assertEqual("missing opening paren at pos 25: 'required i'", str(e))
def test_enum_with_missing_lbrace_raises_exception_with_correct_message( self): s = "enum MissingLBrace NO = 0; YES = 1;}" parser = Parser() try: parser.parse(s) except Exception as e: self.assertEqual("missing opening paren at pos 22: 'NO = 0; '", str(e))
def test_syntax3(self): parser = Parser(syntax3_explicit) parser.parse()
def test_syntax2(self): parser = Parser(syntax2_implicit) parser.parse() parser = Parser(syntax2_explicit) parser.parse()
def test_syntax2(self): parser = Parser() parser.parse(syntax2_implicit) parser.parse(syntax2_explicit)