当前位置: 首页>>代码示例>>Python>>正文


Python disk_list.DiskList类代码示例

本文整理汇总了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')
开发者ID:batmanWjw,项目名称:w3af,代码行数:7,代码来源:click_jacking.py

示例2: test_len

    def test_len(self):
        dl = DiskList()

        for i in xrange(0, 100):
            _ = dl.append(i)

        self.assertEqual(len(dl), 100)
开发者ID:PatidarWeb,项目名称:w3af,代码行数:7,代码来源:test_disk_list.py

示例3: __init__

    def __init__(self):
        GrepPlugin.__init__(self)

        self._total_count = 0
        self._vuln_count = 0
        self._vulns = DiskList()
        self._ids = DiskList()
开发者ID:ElAleyo,项目名称:w3af,代码行数:7,代码来源:cache_control.py

示例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]
开发者ID:andresriancho,项目名称:w3af,代码行数:26,代码来源:test_disk_list.py

示例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)
开发者ID:PatidarWeb,项目名称:w3af,代码行数:7,代码来源:test_disk_list.py

示例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]>')
开发者ID:PatidarWeb,项目名称:w3af,代码行数:7,代码来源:test_disk_list.py

示例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)
开发者ID:PatMart,项目名称:w3af,代码行数:60,代码来源:log_handler.py

示例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)
开发者ID:nunodotferreira,项目名称:w3af,代码行数:8,代码来源:test_disk_list.py

示例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)
开发者ID:PatidarWeb,项目名称:w3af,代码行数:8,代码来源:test_disk_list.py

示例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')
开发者ID:RON313,项目名称:w3af,代码行数:9,代码来源:csp.py

示例11: __init__

    def __init__(self):
        """
        Class init
        """
        GrepPlugin.__init__(self)

        self._total_count = 0
        self._vulns = DiskList()
        self._urls = DiskList() 
开发者ID:3rdDegree,项目名称:w3af,代码行数:9,代码来源:csp.py

示例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))
开发者ID:andresriancho,项目名称:w3af,代码行数:9,代码来源:test_disk_list.py

示例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)
开发者ID:nunodotferreira,项目名称:w3af,代码行数:10,代码来源:test_disk_list.py

示例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)
开发者ID:nunodotferreira,项目名称:w3af,代码行数:10,代码来源:test_disk_list.py

示例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)
开发者ID:PatidarWeb,项目名称:w3af,代码行数:10,代码来源:test_disk_list.py


注:本文中的w3af.core.data.db.disk_list.DiskList类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。