You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
def setUp ( self ) :
"""
wr测试前置初始化方法
会在每个测试方法( 以test_开头的方法) 执行前自动调用
通常用于创建测试数据、初始化测试环境等
本案例暂无需初始化操作,故为空实现
"""
pass
def test_utils ( self ) :
"""
wr核心测试方法: 验证工具函数的基本功能
测试内容包括哈希计算、Markdown转换、字典转URL参数等工具函数
"""
# wr 测试SHA256哈希函数: 对字符串"test"进行哈希计算
md5 = get_sha256 ( ' test ' )
# wr 断言: 哈希结果不为None( 验证函数能正常生成哈希值, 无异常)
self . assertIsNotNone ( md5 )
# wr 测试Markdown转换工具: 处理包含多级语法的Markdown文本
# wr 输入内容包括: 一级标题、Python代码块、两个不同链接
c = CommonMarkdown . get_markdown ( '''
# Title1
```python
import os
```
[url](https://www.lylinux.net/)
[ddd](http://www.baidu.com)
''' )
self . assertIsNotNone ( c )
d = {
' d ' : ' key1 ' ,
' d2 ' : ' key2 '
}
data = parse_dict_to_url ( d )
self . assertIsNotNone ( data )