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)
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))
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))