Exemplo n.º 1
0
 def invalid(self, addr, error=None):
   parser = self.parser()
   if parser:
     got = self.call(parser, "parse", addr)
     expected = "ERROR: %s\n" % error
     assert expected == got, "expected %r, got %r" % (expected, got)
   else:
     ParserBase.invalid(self, addr, error)
Exemplo n.º 2
0
 def invalid(self, addr, error=None):
     parser = self.parser()
     if parser:
         got = self.call(parser, "parse", addr)
         expected = "ERROR: %s\n" % error
         assert expected == got, "expected %r, got %r" % (expected, got)
     else:
         ParserBase.invalid(self, addr, error)
Exemplo n.º 3
0
 def valid(self, addr, name=None, subject=None, options=None):
   parser = self.parser()
   if parser:
     got = self.call(parser, "parse", addr)
     expected = "%s\n" % pprint_address(name, subject, options)
     assert expected == got, "expected\n<EXP>%s</EXP>\ngot\n<GOT>%s</GOT>" % (expected, got)
   else:
     ParserBase.valid(self, addr, (name, subject, options))
Exemplo n.º 4
0
 def valid(self, addr, name=None, subject=None, options=None):
     parser = self.parser()
     if parser:
         got = self.call(parser, "parse", addr)
         expected = "%s\n" % pprint_address(name, subject, options)
         assert expected == got, "expected\n<EXP>%s</EXP>\ngot\n<GOT>%s</GOT>" % (
             expected, got)
     else:
         ParserBase.valid(self, addr, (name, subject, options))