Skip to main content

A Python library for soft assertions and flexible testing.

Project description

hellchin-lib

简介

个人开发使用的一些工具包,主要用于自动化测试,目前主要开发断言功能,支持软硬断言。

安装

pip install hellchin-lib

使用方法

!!!详细教程有空的时候再进行更新

建议教程如下:

示例代码:

# !/usr/bin/env python
# -*- coding: utf-8 -*-
"""
 -------------------------------------------------
    File Name:     test_demo.py
    Description:   
 -------------------------------------------------
 """

from hellchin_lib import PostManAssertMethod, MethodAssert

pm = PostManAssertMethod()
pm.response = {
    "a": 1
}

# raise Exception("测试")
pm_code_test = """
# pm.expect(1).to.equal(2)
pm.test("", lambda: pm.expect('1').to.equal(1))
pm.test("失败断言", lambda: pm.expect(1).to.equal(2))
pm.test("", lambda: pm.expect(1).to.equal(1))
pm.test("成功断言", lambda: pm.expect(1).to.equal(1))
res = pm.response.json()
pm.test("undefined 测试", lambda: pm.expect(res.b).to.equal(1))
# pm.expect(res.b).to.equal(1)
"""

exec(pm_code_test, {"pm": pm})

ma_code_test = """
method_assert.check(1 == 1)
method_assert.check(1 == 2)
method_assert.equal(1, 1)
method_assert.equal(1, 2)
method_assert.exists(1)
method_assert.fail()
"""

# exec(ma_code_test, {"method_assert": MethodAssert()})

文档链接

更多文档请访问:None

更新日志

[0.1.401] - 2024-1-3

新增

  • pm 断言: 添加 undefined 处理

修复

  • 修复了一些问题
  • 修复日志无引用问题

改进

  • 优化了一些细节代码和冗余

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hellchin_lib-0.1.401.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hellchin_lib-0.1.401-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

Details for the file hellchin_lib-0.1.401.tar.gz.

File metadata

  • Download URL: hellchin_lib-0.1.401.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.16

File hashes

Hashes for hellchin_lib-0.1.401.tar.gz
Algorithm Hash digest
SHA256 3f9e2bb685d12fac5e08f1a79a3fde1e3578019a6727c80ecc5cbf79dc92f7f7
MD5 d616b33b8adefc0cb61690e3b61e0ea5
BLAKE2b-256 d1884af85163e2c6143a7fb7ff3adaa00d828561a40fa0ee71988cff74a310cb

See more details on using hashes here.

File details

Details for the file hellchin_lib-0.1.401-py3-none-any.whl.

File metadata

  • Download URL: hellchin_lib-0.1.401-py3-none-any.whl
  • Upload date:
  • Size: 13.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.16

File hashes

Hashes for hellchin_lib-0.1.401-py3-none-any.whl
Algorithm Hash digest
SHA256 81ccddcc2d4c76e037a856544df4c687f65d541f162f2599c7fa9fc8d6bff9d5
MD5 a547a1eed07ac2bcc3452738198b4968
BLAKE2b-256 7ea8102a29856787b876dfb27b7e1178e4c4aaaffe23e0f3a99c2f59a55905f0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page