本文整理汇总了Python中w3af.core.data.db.disk_list.DiskList类的典型用法代码示例。如果您正苦于以下问题:Python DiskList类的具体用法?Python DiskList怎么用?Python DiskList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DiskList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self):
GrepPlugin.__init__(self)
self._total_count = 0
self._vuln_count = 0
self._vulns = DiskList(table_prefix='click_jacking')
self._ids = DiskList(table_prefix='click_jacking')
示例2: test_len
def test_len(self):
dl = DiskList()
for i in xrange(0, 100):
_ = dl.append(i)
self.assertEqual(len(dl), 100)
示例3: __init__
def __init__(self):
GrepPlugin.__init__(self)
self._total_count = 0
self._vuln_count = 0
self._vulns = DiskList()
self._ids = DiskList()
示例4: test_specific_serializer_with_http_response
def test_specific_serializer_with_http_response(self):
#
# This test runs in 26.42 seconds on my workstation
#
body = '<html><a href="http://moth/abc.jsp">test</a></html>'
headers = Headers([('Content-Type', 'text/html')])
url = URL('http://w3af.com')
response = HTTPResponse(200, body, headers, url, url, _id=1)
def dump(http_response):
return msgpack.dumps(http_response.to_dict(),
use_bin_type=True)
def load(serialized_object):
data = msgpack.loads(serialized_object, raw=False)
return HTTPResponse.from_dict(data)
count = 30000
dl = DiskList(dump=dump, load=load)
for i in xrange(0, count):
# This tests the serialization
dl.append(response)
# This tests the deserialization
_ = dl[i]
示例5: test_remove_table_then_add
def test_remove_table_then_add(self):
disk_list = DiskList()
disk_list.append(1)
disk_list.cleanup()
self.assertRaises(AssertionError, disk_list.append, 1)
示例6: test_to_unicode
def test_to_unicode(self):
dl = DiskList()
dl.append(1)
dl.append(2)
dl.append(3)
self.assertEqual(unicode(dl), u'<DiskList [1, 2, 3]>')
示例7: RESTAPIOutput
class RESTAPIOutput(OutputPlugin):
"""
Store all log messages on a DiskList
:author: Andres Riancho ([email protected])
"""
def __init__(self):
super(RESTAPIOutput, self).__init__()
self.log = DiskList(table_prefix='RestApiScanLog')
self.log_id = -1
def get_log_id(self):
self.log_id += 1
return self.log_id
def debug(self, msg_string, new_line=True):
"""
This method is called from the output object. The output object was
called from a plugin or from the framework. This method should take an
action for debug messages.
"""
m = Message(DEBUG, self._clean_string(msg_string), self.get_log_id())
self.log.append(m)
def information(self, msg_string, new_line=True):
"""
This method is called from the output object. The output object was
called from a plugin or from the framework. This method should take an
action for informational messages.
"""
m = Message(INFORMATION, self._clean_string(msg_string),
self.get_log_id())
self.log.append(m)
def error(self, msg_string, new_line=True):
"""
This method is called from the output object. The output object was
called from a plugin or from the framework. This method should take an
action for error messages.
"""
m = Message(ERROR, self._clean_string(msg_string), self.get_log_id())
self.log.append(m)
def vulnerability(self, msg_string, new_line=True, severity=MEDIUM):
"""
This method is called from the output object. The output object was
called from a plugin or from the framework. This method should take an
action when a vulnerability is found.
"""
m = Message(VULNERABILITY, self._clean_string(msg_string),
self.get_log_id())
m.set_severity(severity)
self.log.append(m)
def console(self, msg_string, new_line=True):
"""
This method is used by the w3af console to print messages to the outside
"""
m = Message(CONSOLE, self._clean_string(msg_string), self.get_log_id())
self.log.append(m)
示例8: test_slice_all
def test_slice_all(self):
disk_list = DiskList()
disk_list.append("1")
disk_list.append("2")
dl_copy = disk_list[:]
self.assertIn("1", dl_copy)
self.assertIn("2", dl_copy)
示例9: test_slice_all
def test_slice_all(self):
disk_list = DiskList()
disk_list.append('1')
disk_list.append('2')
dl_copy = disk_list[:]
self.assertIn('1', dl_copy)
self.assertIn('2', dl_copy)
示例10: __init__
def __init__(self):
"""
Class init
"""
GrepPlugin.__init__(self)
self._total_count = 0
self._vulns = DiskList(table_prefix='csp')
self._urls = DiskList(table_prefix='csp')
示例11: __init__
def __init__(self):
"""
Class init
"""
GrepPlugin.__init__(self)
self._total_count = 0
self._vulns = DiskList()
self._urls = DiskList()
示例12: test_slice_greater_than_length
def test_slice_greater_than_length(self):
disk_list = DiskList()
disk_list.append('1')
disk_list.append('2')
dl_copy = disk_list[:50]
self.assertIn('1', dl_copy)
self.assertIn('2', dl_copy)
self.assertEqual(2, len(dl_copy))
示例13: test_slice_first_N
def test_slice_first_N(self):
disk_list = DiskList()
disk_list.append("1")
disk_list.append("2")
disk_list.append("3")
dl_copy = disk_list[:1]
self.assertIn("1", dl_copy)
self.assertNotIn("2", dl_copy)
self.assertNotIn("3", dl_copy)
示例14: test_sorted
def test_sorted(self):
dl = DiskList()
dl.append("abc")
dl.append("def")
dl.append("aaa")
sorted_dl = sorted(dl)
self.assertEqual(["aaa", "abc", "def"], sorted_dl)
示例15: test_urlobject
def test_urlobject(self):
dl = DiskList()
dl.append(URL('http://w3af.org/?id=2'))
dl.append(URL('http://w3af.org/?id=3'))
self.assertEqual(dl[0], URL('http://w3af.org/?id=2'))
self.assertEqual(dl[1], URL('http://w3af.org/?id=3'))
self.assertFalse(URL('http://w3af.org/?id=4') in dl)
self.assertTrue(URL('http://w3af.org/?id=2') in dl)