示例#1
0
    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))
示例#2
0
    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))
示例#3
0
    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))
示例#4
0
    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))
示例#5
0
 def test_syntax3(self):
     parser = Parser(syntax3_explicit)
     parser.parse()
示例#6
0
 def test_syntax2(self):
     parser = Parser(syntax2_implicit)
     parser.parse()
     parser = Parser(syntax2_explicit)
     parser.parse()
示例#7
0
 def test_syntax2(self):
     parser = Parser()
     parser.parse(syntax2_implicit)
     parser.parse(syntax2_explicit)