def test_check_case09(self): is_vuln = IsVulnerableHelper(200, 301, re.compile('def'), re.compile('xyz'), re.compile('spam')) url = URL('http://moth/') http_response = HTTPResponse(301, 'hello world abc def', Headers(), url, url) self.assertTrue( is_vuln.check(http_response) )
def test_check_case09(self): is_vuln = IsVulnerableHelper(200, 301, re.compile('def'), re.compile('xyz'), re.compile('spam')) url = URL('http://moth/') http_response = HTTPResponse(301, 'hello world abc def', Headers(), url, url) self.assertTrue(is_vuln.check(http_response))
def test_check_case02(self): is_vuln = IsVulnerableHelper(re.compile('xyz'), None, None, None, None) url = URL('http://moth/') http_response = HTTPResponse(200, 'hello world abc def', Headers(), url, url) self.assertFalse(is_vuln.check(http_response))
def test_checks_only_response_code_case04(self): is_vuln = IsVulnerableHelper(re.compile('a'), re.compile('b'), None, None, None) self.assertFalse(is_vuln.checks_only_response_code())
def test_checks_only_response_code_case02(self): is_vuln = IsVulnerableHelper(200, 302, None, None, None) self.assertTrue(is_vuln.checks_only_response_code())
def test_check_case05(self): is_vuln = IsVulnerableHelper(200, 301, None, None, None) url = URL('http://moth/') http_response = HTTPResponse(301, 'hello world abc def', Headers(), url, url) self.assertTrue(is_vuln.check(http_response))
def test_check_case02(self): is_vuln = IsVulnerableHelper(re.compile('xyz'), None, None, None, None) url = URL('http://moth/') http_response = HTTPResponse(200, 'hello world abc def', Headers(), url, url) self.assertFalse( is_vuln.check(http_response) )
def test_checks_only_response_code_case04(self): is_vuln = IsVulnerableHelper(re.compile('a'), re.compile('b'), None, None, None) self.assertFalse( is_vuln.checks_only_response_code() )
def test_checks_only_response_code_case02(self): is_vuln = IsVulnerableHelper(200, 302, None, None, None) self.assertTrue( is_vuln.checks_only_response_code() )
def test_check_case05(self): is_vuln = IsVulnerableHelper(200, 301, None, None, None) url = URL('http://moth/') http_response = HTTPResponse(301, 'hello world abc def', Headers(), url, url) self.assertTrue( is_vuln.check(http_response) )