def assert_error(self, expected, host, origin, referer): try: result = guess_child_domain(host, origin, referer) message = ('Expected error: %s, got: %s for %r' % (expected, result, [host, origin, referer])) self.fail(message) except DomainRelationshipException as e: assert (expected, e.message)
def assert_domain(self, expected, host, origin, referer): try: self.assertEqual(expected, guess_child_domain(host, origin, referer)) except DomainRelationshipException as e: message = ('Expected: %s, got error: %s for %r' % (expected, e, [host, origin, referer])) self.fail(message)
def assert_error(self, expected, host, origin, referer, qsreferer): try: result = guess_child_domain(host, origin, referer, qsreferer) message = ('Expected error: %s, got: %s for %r' % ( expected, result, [host, origin, referer, qsreferer])) self.fail(message) except DomainRelationshipException as e: assert(expected, e.message)
def assert_domain(self, expected, host, origin, referer, qsreferer): try: self.assertEqual( expected, guess_child_domain(host, origin, referer, qsreferer)) except DomainRelationshipException as e: message = ('Expected: %s, got error: %s for %r' % ( expected, e, [host, origin, referer, qsreferer])) self.fail(message)