コード例 #1
0
 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)
コード例 #2
0
 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)
コード例 #3
0
 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)
コード例 #4
0
 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)