• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python disk_list.DiskList类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中w3af.core.data.db.disk_list.DiskList的典型用法代码示例。如果您正苦于以下问题:Python DiskList类的具体用法?Python DiskList怎么用?Python DiskList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了DiskList类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


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


示例17: test_remove_table

 def test_remove_table(self):
     disk_list = DiskList()
     table_name = disk_list.table_name
     db = get_default_temp_db_instance()
     
     self.assertTrue(db.table_exists(table_name))
     
     disk_list.cleanup()
     
     self.assertFalse(db.table_exists(table_name))
开发者ID:PatidarWeb,项目名称:w3af,代码行数:10,代码来源:test_disk_list.py


示例18: test_getitem_negative

    def test_getitem_negative(self):
        dl = DiskList()

        dl.append('a')
        dl.append('b')
        dl.append('c')

        self.assertEqual(dl[-1], 'c')
        self.assertEqual(dl[-2], 'b')
        self.assertEqual(dl[-3], 'a')
        self.assertRaises(IndexError, dl.__getitem__, -4)
开发者ID:PatidarWeb,项目名称:w3af,代码行数:11,代码来源:test_disk_list.py


示例19: test_islice

 def test_islice(self):
     disk_list = DiskList()
     disk_list.extend('ABCDEFG')
     
     EXPECTED = 'CDEFG'
     result = ''
     
     for c in itertools.islice(disk_list, 2, None, None):
         result += c
     
     self.assertEqual(EXPECTED, result)
开发者ID:PatidarWeb,项目名称:w3af,代码行数:11,代码来源:test_disk_list.py


示例20: test_islice

    def test_islice(self):
        disk_list = DiskList()
        disk_list.extend("ABCDEFG")

        EXPECTED = "CDEFG"
        result = ""

        for c in itertools.islice(disk_list, 2, None, None):
            result += c

        self.assertEqual(EXPECTED, result)
开发者ID:nunodotferreira,项目名称:w3af,代码行数:11,代码来源:test_disk_list.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python disk_set.DiskSet类代码示例发布时间:2022-05-26
下一篇:
Python disk_dict.DiskDict类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap