Skip to main content

一个属于软件测试工程师使用的工具库.

Project description

hellchin-lib

简介

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

安装

pip install hellchin-lib

项目关键结构

项目文件结构如下:

my_tool/
├── my_tool/            # 项目的源代码目录。
│   ├── __init__.py
│   ├── main.py
├── setup.py            # 项目的安装脚本,用于将项目打包为可安装的包。
├── pyproject.toml      # 项目配置文件,用于定义项目信息、依赖项等。
├── README.md           # 项目说明文件。
├── LICENSE             # 项目许可证文件。
└── requirements.txt    # 项目依赖的第三方库列表。

使用方法

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

建议教程如下:

示例代码:

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

from hellchin 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-0.0.1.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

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

hellchin-0.0.1-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

Details for the file hellchin-0.0.1.tar.gz.

File metadata

  • Download URL: hellchin-0.0.1.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for hellchin-0.0.1.tar.gz
Algorithm Hash digest
SHA256 a3f8c2d999533b67717d32a74bbf2819415132cca10d6113c69e7d802d5ae28c
MD5 a1980f6f0a7e65aaefce7ee8f43fe6e4
BLAKE2b-256 c4214a5b34976071330a57046736370072bf90c2a182ced9c8321773b9f2f824

See more details on using hashes here.

File details

Details for the file hellchin-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: hellchin-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 14.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for hellchin-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b0358b358dbbcbb298143f8d4679b437ffd81ebabf6648e3508fcb756ae33f60
MD5 733473d1e404176d7e39c4ed6d5059a1
BLAKE2b-256 9056a98ac754fe73b4131a45231ba61f65d688f72b1ce44c2e08de37e09763b4

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