pytest-dsl 0.7.0__py3-none-any.whl → 0.9.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pytest_dsl/cli.py +334 -15
- pytest_dsl/core/custom_keyword_manager.py +49 -48
- pytest_dsl/core/dsl_executor.py +102 -14
- pytest_dsl/core/lexer.py +8 -2
- pytest_dsl/core/parser.py +18 -3
- pytest_dsl/core/parsetab.py +71 -66
- {pytest_dsl-0.7.0.dist-info → pytest_dsl-0.9.0.dist-info}/METADATA +49 -1
- {pytest_dsl-0.7.0.dist-info → pytest_dsl-0.9.0.dist-info}/RECORD +12 -12
- {pytest_dsl-0.7.0.dist-info → pytest_dsl-0.9.0.dist-info}/entry_points.txt +1 -0
- {pytest_dsl-0.7.0.dist-info → pytest_dsl-0.9.0.dist-info}/WHEEL +0 -0
- {pytest_dsl-0.7.0.dist-info → pytest_dsl-0.9.0.dist-info}/licenses/LICENSE +0 -0
- {pytest_dsl-0.7.0.dist-info → pytest_dsl-0.9.0.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: pytest-dsl
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.9.0
|
4
4
|
Summary: A DSL testing framework based on pytest
|
5
5
|
Author: Chen Shuanglin
|
6
6
|
License: MIT
|
@@ -114,8 +114,32 @@ version = "1.0.0"
|
|
114
114
|
# 数字变量
|
115
115
|
port = 8080
|
116
116
|
|
117
|
+
# 布尔值变量
|
118
|
+
is_enabled = True
|
119
|
+
is_disabled = False
|
120
|
+
|
117
121
|
# 列表
|
118
122
|
users = ["alice", "bob", "charlie"]
|
123
|
+
|
124
|
+
# 字典
|
125
|
+
user_info = {"name": "张三", "age": 30, "city": "北京"}
|
126
|
+
|
127
|
+
# 嵌套字典
|
128
|
+
config = {
|
129
|
+
"database": {
|
130
|
+
"host": "localhost",
|
131
|
+
"port": 3306,
|
132
|
+
"name": "test_db"
|
133
|
+
},
|
134
|
+
"api": {
|
135
|
+
"base_url": "https://api.example.com",
|
136
|
+
"timeout": 30
|
137
|
+
}
|
138
|
+
}
|
139
|
+
|
140
|
+
# 访问字典值
|
141
|
+
username = ${user_info["name"]}
|
142
|
+
db_host = ${config["database"]["host"]}
|
119
143
|
```
|
120
144
|
|
121
145
|
#### 流程控制
|
@@ -129,12 +153,33 @@ else
|
|
129
153
|
[打印], 内容: "测试失败"
|
130
154
|
end
|
131
155
|
|
156
|
+
# 使用布尔值的条件判断
|
157
|
+
is_ready = True
|
158
|
+
if ${is_ready} do
|
159
|
+
[打印], 内容: "系统就绪"
|
160
|
+
end
|
161
|
+
|
132
162
|
# 循环结构
|
133
163
|
num = 4
|
134
164
|
for i in range(1, num) do
|
135
165
|
[打印], 内容: "执行第 ${i} 次"
|
136
166
|
end
|
137
167
|
|
168
|
+
# 循环中的break和continue
|
169
|
+
for j in range(1, 11) do
|
170
|
+
# 跳过偶数
|
171
|
+
if ${j} % 2 == 0 do
|
172
|
+
continue
|
173
|
+
end
|
174
|
+
|
175
|
+
# 当达到7时退出循环
|
176
|
+
if ${j} == 7 do
|
177
|
+
[打印], 内容: "达到7,退出循环"
|
178
|
+
break
|
179
|
+
end
|
180
|
+
|
181
|
+
[打印], 内容: "奇数: ${j}"
|
182
|
+
end
|
138
183
|
```
|
139
184
|
|
140
185
|
### 2. 内置关键字详解
|
@@ -1034,6 +1079,9 @@ pytest-dsl api_basic.dsl
|
|
1034
1079
|
- ✅ 断言重试机制
|
1035
1080
|
- ✅ 认证功能示例
|
1036
1081
|
- ✅ 数据驱动测试(pytest集成)
|
1082
|
+
- ✅ 布尔值支持和条件判断
|
1083
|
+
- ✅ 字典定义和嵌套访问
|
1084
|
+
- ✅ 循环控制语句(break/continue)
|
1037
1085
|
|
1038
1086
|
---
|
1039
1087
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
pytest_dsl/__init__.py,sha256=FzwXGvmuvMhRBKxvCdh1h-yJ2wUOnDxcTbU4Nt5fHn8,301
|
2
|
-
pytest_dsl/cli.py,sha256=
|
2
|
+
pytest_dsl/cli.py,sha256=4X-nq7TdBgFGN9oDBhgNHaoLBmTV0WQ_uxNY6cdRS4M,14944
|
3
3
|
pytest_dsl/conftest_adapter.py,sha256=cevEb0oEZKTZfUrGe1-CmkFByxKhUtjuurBJP7kpLc0,149
|
4
4
|
pytest_dsl/main_adapter.py,sha256=pUIPN_EzY3JCDlYK7yF_OeLDVqni8vtG15G7gVzPJXg,181
|
5
5
|
pytest_dsl/plugin.py,sha256=MEQcdK0xdxwxCxPEDLNHX_kGF9Jc7bNxlNi4mx588DU,1190
|
@@ -8,16 +8,16 @@ pytest_dsl/core/auth_provider.py,sha256=IZfXXrr4Uuc8QHwRPvhHSzNa2fwrqhjYts1xh78D
|
|
8
8
|
pytest_dsl/core/auto_decorator.py,sha256=9Mga-GB4AzV5nkB6zpfaq8IuHa0KOH8LlFvnWyH_tnU,6623
|
9
9
|
pytest_dsl/core/auto_directory.py,sha256=egyTnVxtGs4P75EIivRauLRPJfN9aZpoGVvp_Ma72AM,2714
|
10
10
|
pytest_dsl/core/context.py,sha256=fXpVQon666Lz_PCexjkWMBBr-Xcd1SkDMp2vHar6eIs,664
|
11
|
-
pytest_dsl/core/custom_keyword_manager.py,sha256=
|
12
|
-
pytest_dsl/core/dsl_executor.py,sha256=
|
11
|
+
pytest_dsl/core/custom_keyword_manager.py,sha256=Y3MftSklqGSS3FfeZjmyfcGHfQw6FrhFTwgS_O8zQh4,7606
|
12
|
+
pytest_dsl/core/dsl_executor.py,sha256=aEEfocFCFxNDN1puBFhQzL5fzw9eZx8BAyYJI5XSt4Y,30472
|
13
13
|
pytest_dsl/core/dsl_executor_utils.py,sha256=cFoR2p3qQ2pb-UhkoefleK-zbuFqf0aBLh2Rlp8Ebs4,2180
|
14
14
|
pytest_dsl/core/global_context.py,sha256=NcEcS2V61MT70tgAsGsFWQq0P3mKjtHQr1rgT3yTcyY,3535
|
15
15
|
pytest_dsl/core/http_client.py,sha256=1AHqtM_fkXf8JrM0ljMsJwUkyt-ysjR16NoyCckHfGc,15810
|
16
16
|
pytest_dsl/core/http_request.py,sha256=nGMlx0mFc7rDLIdp9GJ3e09OQH3ryUA56yJdRZ99dOQ,57445
|
17
17
|
pytest_dsl/core/keyword_manager.py,sha256=FtPsXlI7PxvVQMJfDN_nQYvRhkag5twvaHXjELQsCEo,4068
|
18
|
-
pytest_dsl/core/lexer.py,sha256=
|
19
|
-
pytest_dsl/core/parser.py,sha256=
|
20
|
-
pytest_dsl/core/parsetab.py,sha256=
|
18
|
+
pytest_dsl/core/lexer.py,sha256=WaLzt9IhtHiA90Fg2WGgfVztveCUhtgxzANBaEiy-F8,4347
|
19
|
+
pytest_dsl/core/parser.py,sha256=xxy6yC6NdwHxln200aIuaWWN3w44uI8kkNlw8PTVpYI,11855
|
20
|
+
pytest_dsl/core/parsetab.py,sha256=aN-2RRTr3MSbMyfe-9zOj_t96Xu84avE29GWqH6nqmg,31472
|
21
21
|
pytest_dsl/core/plugin_discovery.py,sha256=vcO4-I9o4GSffLDd36idhOz6XUI1K7JhOQWwhpCDoNw,6523
|
22
22
|
pytest_dsl/core/utils.py,sha256=q0AMdw5HO33JvlA3UJeQ7IXh1Z_8K1QlwiM1_yiITrU,5350
|
23
23
|
pytest_dsl/core/variable_utils.py,sha256=sx5DFZAO_syi0E_0ACisiZUQL9yxGeOfNmMtV6w9V3E,13947
|
@@ -59,9 +59,9 @@ pytest_dsl/keywords/assertion_keywords.py,sha256=WOCGP7WX2wZ6mQPDGmi38LWdG2NaThH
|
|
59
59
|
pytest_dsl/keywords/global_keywords.py,sha256=4yw5yeXoGf_4W26F39EA2Pp-mH9GiKGy2jKgFO9a_wM,2509
|
60
60
|
pytest_dsl/keywords/http_keywords.py,sha256=DY1SvUgOziN6Ga-QgE0q4XFd2qGGwvbv1B_k2gTdPLw,25554
|
61
61
|
pytest_dsl/keywords/system_keywords.py,sha256=n_jRrMvSv2v6Pm_amokfyLNVOLYP7CFWbBE3_dlO7h4,11299
|
62
|
-
pytest_dsl-0.
|
63
|
-
pytest_dsl-0.
|
64
|
-
pytest_dsl-0.
|
65
|
-
pytest_dsl-0.
|
66
|
-
pytest_dsl-0.
|
67
|
-
pytest_dsl-0.
|
62
|
+
pytest_dsl-0.9.0.dist-info/licenses/LICENSE,sha256=Rguy8cb9sYhK6cmrBdXvwh94rKVDh2tVZEWptsHIsVM,1071
|
63
|
+
pytest_dsl-0.9.0.dist-info/METADATA,sha256=it5pFZgvhb4OBllvC5vPxn-rezLeMsvGVtjPrtEDw6g,26712
|
64
|
+
pytest_dsl-0.9.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
65
|
+
pytest_dsl-0.9.0.dist-info/entry_points.txt,sha256=vuYIReCjHhS_cpaPAbQxOnFavQAwW0K66dKxUQSsRvc,190
|
66
|
+
pytest_dsl-0.9.0.dist-info/top_level.txt,sha256=4CrSx4uNqxj7NvK6k1y2JZrSrJSzi-UvPZdqpUhumWM,11
|
67
|
+
pytest_dsl-0.9.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|