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


Python TestUtils.buffers_equal方法代码示例

本文整理汇总了Python中test_utils.TestUtils.buffers_equal方法的典型用法代码示例。如果您正苦于以下问题:Python TestUtils.buffers_equal方法的具体用法?Python TestUtils.buffers_equal怎么用?Python TestUtils.buffers_equal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在test_utils.TestUtils的用法示例。


在下文中一共展示了TestUtils.buffers_equal方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: data_handler

# 需要导入模块: from test_utils import TestUtils [as 别名]
# 或者: from test_utils.TestUtils import buffers_equal [as 别名]
            def data_handler(data):
                tu.check_context()
                received.append_buffer(data)

                if received.length == sends * size:
                    tu.azzert(TestUtils.buffers_equal(sent, received))
                    tu.test_complete()
开发者ID:Findekano,项目名称:vert.x,代码行数:9,代码来源:test_client.py

示例2: end_handler

# 需要导入模块: from test_utils import TestUtils [as 别名]
# 或者: from test_utils.TestUtils import buffers_equal [as 别名]
 def end_handler(stream):
     tu.azzert(TestUtils.buffers_equal(tot_buff, tot_read))
     tu.check_context
     def close_handler2(err, result):
         tu.check_context()
         tu.test_complete()
     file.close(close_handler2)
开发者ID:aaronwalker,项目名称:vert.x,代码行数:9,代码来源:test_client.py

示例3: end_handler

# 需要导入模块: from test_utils import TestUtils [as 别名]
# 或者: from test_utils.TestUtils import buffers_equal [as 别名]
 def end_handler(stream):
     tu.check_context()
     tu.azzert(TestUtils.buffers_equal(sent_buff, body))
     if chunked:
         tu.azzert('vtrailer1' == resp.trailers['trailer1'])
         tu.azzert('vtrailer2' == resp.trailers['trailer2'])
     tu.test_complete()
开发者ID:Findekano,项目名称:vert.x,代码行数:9,代码来源:test_client.py

示例4: end_handler

# 需要导入模块: from test_utils import TestUtils [as 别名]
# 或者: from test_utils.TestUtils import buffers_equal [as 别名]
 def end_handler(stream):
     tu.check_context()
     if method != "HEAD" and method != "CONNECT":
         tu.azzert(TestUtils.buffers_equal(sent_buff, body))
         if chunked:
             tu.azzert("vtrailer1" == resp.trailers["trailer1"])
             tu.azzert("vtrailer2" == resp.trailers["trailer2"])
     tu.test_complete()
开发者ID:jdonnerstag,项目名称:vert.x,代码行数:10,代码来源:test_client.py

示例5: test_hash

# 需要导入模块: from test_utils import TestUtils [as 别名]
# 或者: from test_utils.TestUtils import buffers_equal [as 别名]
    def test_hash(self):
        hash1 = SharedData.get_hash("map1")
        tu.azzert(hash1 != None)
        hash2 = SharedData.get_hash("map1")
        tu.azzert(hash2 != None)

        tu.azzert(hash1 == hash2)

        hash3 = SharedData.get_hash("map3")
        tu.azzert(hash3 != None)
        tu.azzert(hash1 != hash3)

        key = 'wibble'

        hash1[key] = 'hello'

        tu.azzert(hash1[key] == 'hello')
        tu.azzert(hash2[key] == 'hello')
        tu.azzert(isinstance(hash1[key], unicode)) # Make sure it's not a Java String

        hash1[key] = 12
        tu.azzert(hash1[key] == 12)
        tu.azzert(hash2[key] == 12)

        hash1[key] = 1.2344
        tu.azzert(hash1[key] == 1.2344)
        tu.azzert(hash2[key] == 1.2344)

        hash1[key] = True
        tu.azzert(hash1[key] == True)
        tu.azzert(hash2[key] == True)

        hash1[key] = False
        tu.azzert(hash1[key] == False)
        tu.azzert(hash2[key] == False)

        succeeded = False
        try:
            hash1[key] = SomeOtherClass()
            succeeded = True
        except:
            pass # OK
          
        tu.azzert(not succeeded, 'Should throw exception')

        # Make sure it deals with Ruby buffers ok, and copies them
        buff1 = TestUtils.gen_buffer(100)
        hash1[key] = buff1
        buff2 = hash1[key]
        tu.azzert(isinstance(buff2, Buffer))
        tu.azzert(buff1 != buff2)
        tu.azzert(TestUtils.buffers_equal(buff1, buff2))

        tu.azzert(SharedData.remove_hash("map1"))
        tu.azzert(not SharedData.remove_hash("map1"))
        tu.azzert(SharedData.remove_hash("map3"))
        tu.test_complete()
开发者ID:aaronwalker,项目名称:vert.x,代码行数:59,代码来源:test_client.py

示例6: data_handler

# 需要导入模块: from test_utils import TestUtils [as 别名]
# 或者: from test_utils.TestUtils import buffers_equal [as 别名]
            def data_handler(data):
                tu.check_thread()
                tu.azzert(TestUtils.buffers_equal(buffer, data.data))

                def send_handler(err, sock):
                    tu.check_thread()
                    tu.azzert(err is None)
                    tu.azzert(sock == peer2)

                peer2.send('127.0.0.1', 1235, data.data, send_handler)
开发者ID:fregaham,项目名称:mod-lang-jython,代码行数:12,代码来源:test_client.py

示例7: read_handler

# 需要导入模块: from test_utils import TestUtils [as 别名]
# 或者: from test_utils.TestUtils import buffers_equal [as 别名]
 def read_handler(err, buff):
     tu.check_context
     tu.azzert(err == None)
     self.read += 1
     if self.read == num_chunks:
         # all read
         tu.azzert(TestUtils.buffers_equal(tot_buff, tot_read))
         def close_handler(err, res):
             tu.check_context()
             tu.test_complete()
         file.close(close_handler)
开发者ID:aaronwalker,项目名称:vert.x,代码行数:13,代码来源:test_client.py

示例8: end_handler

# 需要导入模块: from test_utils import TestUtils [as 别名]
# 或者: from test_utils.TestUtils import buffers_equal [as 别名]
        def end_handler():
            tu.check_thread()
            if method != 'HEAD' and method != 'CONNECT':
                tu.azzert(TestUtils.buffers_equal(sent_buff, body))
                if chunked:
                    tu.azzert('vtrailer1' == resp.trailers['trailer1'])
                    tu.azzert('vtrailer2' == resp.trailers['trailer2'])

            resp.headers.clear()
            tu.azzert(resp.headers.is_empty)
            tu.test_complete()
开发者ID:fregaham,项目名称:mod-lang-jython,代码行数:13,代码来源:test_client.py

示例9: each7

# 需要导入模块: from test_utils import TestUtils [as 别名]
# 或者: from test_utils.TestUtils import buffers_equal [as 别名]
 def each7(elem):
     tu.azzert(TestUtils.buffers_equal(buff, elem))
     tu.azzert(buff != elem)
     tu.azzert(isinstance(elem, Buffer))
开发者ID:aaronwalker,项目名称:vert.x,代码行数:6,代码来源:test_client.py


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