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


Python JTLErrorsReader.get_data方法代码示例

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


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

示例1: test_embedded_resources_no_fail

# 需要导入模块: from bzt.modules.jmeter import JTLErrorsReader [as 别名]
# 或者: from bzt.modules.jmeter.JTLErrorsReader import get_data [as 别名]
 def test_embedded_resources_no_fail(self):
     obj = JTLErrorsReader(__dir__() + "/../data/resource-errors-no-fail.jtl", logging.getLogger(''))
     obj.read_file(True)
     values = obj.get_data(sys.maxsize)
     self.assertEqual(values.get('')[0].get("msg"), "success_true_with_failed_embedded_resources")
     self.assertEqual(values.get('')[1].get("msg"), "failed_resource_message")
     self.assertEqual(values.get('HTTP Request')[0].get("msg"), "success_true_with_failed_embedded_resources")
     self.assertEqual(values.get('HTTP Request')[1].get("msg"), "failed_resource_message")
开发者ID:SPSCommerce,项目名称:taurus,代码行数:10,代码来源:test_JMeterExecutor.py

示例2: test_embedded_resources_fail_child_assert

# 需要导入模块: from bzt.modules.jmeter import JTLErrorsReader [as 别名]
# 或者: from bzt.modules.jmeter.JTLErrorsReader import get_data [as 别名]
 def test_embedded_resources_fail_child_assert(self):
     obj = JTLErrorsReader(__dir__() + "/../data/resource-errors-child-assert.jtl", logging.getLogger(''))
     obj.read_file(True)
     values = obj.get_data(sys.maxsize)
     self.assertEqual(values.get('')[0].get("msg"), "subsample assertion error")
     self.assertEqual(values.get('')[1].get("msg"), "NOT FOUND")
     self.assertEqual(values.get('HTTP Request')[0].get("msg"), "subsample assertion error")
     self.assertEqual(values.get('HTTP Request')[1].get("msg"), "NOT FOUND")
开发者ID:SPSCommerce,项目名称:taurus,代码行数:10,代码来源:test_JMeterExecutor.py

示例3: test_resource_tc

# 需要导入模块: from bzt.modules.jmeter import JTLErrorsReader [as 别名]
# 或者: from bzt.modules.jmeter.JTLErrorsReader import get_data [as 别名]
    def test_resource_tc(self):
        obj = JTLErrorsReader(__dir__() + "/../data/resource_tc.jtl", logging.getLogger(''))
        obj.read_file(True)
        values = obj.get_data(sys.maxsize)
        self.assertEqual(values.get('')[0].get("msg"), "message")
        self.assertEqual(values.get('')[1].get("msg"), "FOUND")
        self.assertEqual(values.get('')[2].get("msg"), "second message")
        self.assertEqual(values.get('')[3].get("msg"), "NOT FOUND")
        self.assertEqual(values.get('')[4].get("msg"), "Failed")

        self.assertEqual(values.get('tc1')[0].get("msg"), "FOUND")
        self.assertEqual(values.get('tc3')[0].get("msg"), "message")
        self.assertEqual(values.get('tc3')[1].get("msg"), "second message")
        self.assertEqual(values.get('tc4')[0].get("msg"), "NOT FOUND")
        self.assertEqual(values.get('tc5')[0].get("msg"), "Failed")
开发者ID:SPSCommerce,项目名称:taurus,代码行数:17,代码来源:test_JMeterExecutor.py

示例4: TestJTLErrorsReader

# 需要导入模块: from bzt.modules.jmeter import JTLErrorsReader [as 别名]
# 或者: from bzt.modules.jmeter.JTLErrorsReader import get_data [as 别名]
class TestJTLErrorsReader(BZTestCase):
    def setUp(self):
        super(TestJTLErrorsReader, self).setUp()
        self.obj = None

    def configure(self, jtl_file):
        self.obj = JTLErrorsReader(jtl_file, logging.getLogger(''))

    def tearDown(self):
        close_reader_file(self.obj)
        super(TestJTLErrorsReader, self).tearDown()

    def test_nonstandard_errors_unicode(self):
        self.configure(RESOURCES_DIR + "/jmeter/jtl/nonstandard-unicode.jtl")
        self.obj.read_file(final_pass=True)
        values = self.obj.get_data(sys.maxsize)
        self.assertNotEquals(values[''][0]['msg'].find(u'Cannot find function error in object Файфокс'), -1)
        self.assertNotEquals(values[''][1]['msg'].find('Cannot find function error in object FirefoxDriver'), -1)

    def test_standard_errors_format(self):
        self.configure(RESOURCES_DIR + "/jmeter/jtl/standard-errors.jtl")
        self.obj.read_file(final_pass=True)
        values = self.obj.get_data(sys.maxsize)
        self.assertEquals(3, len(values))
开发者ID:keithmork,项目名称:taurus,代码行数:26,代码来源:test_JTLReader.py

示例5: test_embedded_resources_main_sample_fail_assert

# 需要导入模块: from bzt.modules.jmeter import JTLErrorsReader [as 别名]
# 或者: from bzt.modules.jmeter.JTLErrorsReader import get_data [as 别名]
 def test_embedded_resources_main_sample_fail_assert(self):
     obj = JTLErrorsReader(__dir__() + "/../data/resource-errors-main-assert.jtl", logging.getLogger(''))
     obj.read_file(True)
     values = obj.get_data(sys.maxsize)
     self.assertEqual(values.get('')[0].get("msg"), "Test failed")
     self.assertEqual(values.get('HTTP Request')[0].get("msg"), "Test failed")
开发者ID:SPSCommerce,项目名称:taurus,代码行数:8,代码来源:test_JMeterExecutor.py

示例6: test_standard_errors_format

# 需要导入模块: from bzt.modules.jmeter import JTLErrorsReader [as 别名]
# 或者: from bzt.modules.jmeter.JTLErrorsReader import get_data [as 别名]
 def test_standard_errors_format(self):
     obj = JTLErrorsReader(__dir__() + "/../data/standard-errors.jtl", logging.getLogger(''))
     obj.read_file(True)
     values = obj.get_data(sys.maxsize)
     self.assertEquals(3, len(values))
开发者ID:SPSCommerce,项目名称:taurus,代码行数:7,代码来源:test_JMeterExecutor.py

示例7: test_nonstandard_errors_format

# 需要导入模块: from bzt.modules.jmeter import JTLErrorsReader [as 别名]
# 或者: from bzt.modules.jmeter.JTLErrorsReader import get_data [as 别名]
 def test_nonstandard_errors_format(self):
     obj = JTLErrorsReader(__dir__() + "/../data/nonstandard-errors.jtl", logging.getLogger(''))
     obj.read_file()
     values = obj.get_data(sys.maxsize)
     self.assertNotEquals(values[''][0]['msg'].find('Cannot find function error in object FirefoxDriver'), -1)
开发者ID:dotIN,项目名称:taurus,代码行数:7,代码来源:test_JMeterExecutor.py

示例8: TestJTLErrorsReader

# 需要导入模块: from bzt.modules.jmeter import JTLErrorsReader [as 别名]
# 或者: from bzt.modules.jmeter.JTLErrorsReader import get_data [as 别名]
class TestJTLErrorsReader(BZTestCase):
    def setUp(self):
        super(TestJTLErrorsReader, self).setUp()
        self.obj = None

    def configure(self, jtl_file, err_msg_sep=None):
        self.obj = JTLErrorsReader(jtl_file, ROOT_LOGGER, err_msg_separator=err_msg_sep)

    def tearDown(self):
        close_reader_file(self.obj)
        super(TestJTLErrorsReader, self).tearDown()

    def test_embedded_resources_no_fail(self):
        self.configure(RESOURCES_DIR + "/jmeter/jtl/resource-errors-no-fail.jtl")
        self.obj.read_file()
        values = self.obj.get_data(sys.maxsize)
        self.assertEqual(len(values.get('HTTP Request')), 1)
        self.assertEqual(values.get('HTTP Request')[0].get("msg"), "failed_resource_message")

    def test_embedded_resources_main_sample_fail_assert(self):
        self.configure(RESOURCES_DIR + "/jmeter/jtl/resource-errors-main-assert.jtl")
        self.obj.read_file()
        values = self.obj.get_data(sys.maxsize)
        self.assertEqual(values.get('')[0].get("msg"), "Test failed")
        self.assertEqual(values.get('HTTP Request')[0].get("msg"), "Test failed")

    def test_embedded_resources_fail_child_no_assert(self):
        self.configure(RESOURCES_DIR + "/jmeter/jtl/resource-errors-child-no-assert.jtl")
        self.obj.read_file()
        values = self.obj.get_data(sys.maxsize)
        self.assertEqual(values.get('')[0].get("msg"), "NOT FOUND")
        self.assertEqual(values.get('HTTP Request')[0].get("msg"), "NOT FOUND")

    def test_embedded_resources_fail_child_assert(self):
        self.configure(RESOURCES_DIR + "/jmeter/jtl/resource-errors-child-assert.jtl")
        self.obj.read_file()
        values = self.obj.get_data(sys.maxsize)
        self.assertEqual(1, len(values.get("")))
        self.assertEqual(values.get('')[0].get("msg"), "NOT FOUND")
        self.assertEqual(values.get('HTTP Request')[0].get("msg"), "NOT FOUND")

    def test_bug1(self):
        self.configure(RESOURCES_DIR + "/jmeter/jtl/error-bug1.jtl")
        self.obj.read_file()
        values = self.obj.get_data(sys.maxsize)
        self.assertEqual(9, len(values.get("")))
        self.assertEqual(values.get('')[0].get("msg"), "Non HTTP response message: Connection reset")

    def test_short_err_message(self):
        self.configure(RESOURCES_DIR + "/jmeter/jtl/error-mix.jtl")
        self.obj.read_file()
        values = self.obj.get_data(sys.maxsize)
        self.assertEqual(values.get('')[0].get("msg"), "Not Found")

    def test_full_err_message(self):
        self.configure(RESOURCES_DIR + "/jmeter/jtl/error-mix.jtl", err_msg_sep=" *OMG!* ")
        self.obj.read_file()
        values = self.obj.get_data(sys.maxsize)
        self.assertEqual(values.get('')[0].get("msg"), "Test failed: code expected to contain /777/ *OMG!* Not Found")

    def test_puzzle_jtl(self):
        self.configure(RESOURCES_DIR + "/jmeter/jtl/error-puzzle.jtl")
        self.obj.read_file()
        values = self.obj.get_data(sys.maxsize)
        self.assertEqual(values.get('')[0].get("msg"), "Test failed: text expected not to contain /understanding/")

    def test_resource_tc(self):
        self.configure(RESOURCES_DIR + "/jmeter/jtl/resource_tc.jtl")
        self.obj.read_file()
        values = self.obj.get_data(sys.maxsize)
        self.assertEqual(4, len(values.get("")))
        self.assertEqual(values.get('')[0].get("msg"), "message")
        self.assertEqual(values.get('')[1].get("msg"), "FOUND")
        self.assertEqual(values.get('')[2].get("msg"), "second message")
        self.assertEqual(values.get('')[3].get("msg"), "NOT FOUND")
        self.assertEqual(values.get('')[3].get("cnt"), 2)

        self.assertEqual(values.get('tc1')[0].get("msg"), "FOUND")
        self.assertEqual(values.get("tc1")[0].get("type"), KPISet.ERRTYPE_SUBSAMPLE)
        self.assertEqual(values.get('tc3')[0].get("msg"), "message")
        self.assertEqual(values.get("tc3")[0].get("type"), KPISet.ERRTYPE_ERROR)
        self.assertEqual(values.get("tc3")[1].get("type"), KPISet.ERRTYPE_ERROR)
        self.assertEqual(values.get('tc3')[1].get("msg"), "second message")
        self.assertEqual(values.get('tc4')[0].get("msg"), "NOT FOUND")
        self.assertEqual(values.get("tc4")[0].get("type"), KPISet.ERRTYPE_SUBSAMPLE)
        self.assertEqual(values.get('tc5')[0].get("msg"), "NOT FOUND")
        self.assertEqual(values.get("tc5")[0].get("type"), KPISet.ERRTYPE_SUBSAMPLE)

    def test_nonstandard_errors_unicode(self):
        self.configure(RESOURCES_DIR + "/jmeter/jtl/nonstandard-unicode.jtl")
        self.obj.read_file(final_pass=True)
        values = self.obj.get_data(sys.maxsize)
        self.assertNotEquals(values[''][0]['msg'].find(u'Cannot find function error in object Файфокс'), -1)
        self.assertNotEquals(values[''][1]['msg'].find('Cannot find function error in object FirefoxDriver'), -1)

    def test_standard_errors_format(self):
        self.configure(RESOURCES_DIR + "/jmeter/jtl/standard-errors.jtl")
        self.obj.read_file(final_pass=True)
        values = self.obj.get_data(sys.maxsize)
        self.assertEquals(3, len(values))
#.........这里部分代码省略.........
开发者ID:andy7i,项目名称:taurus,代码行数:103,代码来源:test_JTLReader.py


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