mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-17 03:37:36 +08:00
#29: refactor validator:
1, relocate validate functions; 2, add unittest for custom defined validators.
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
{"eq": ["status_code", 200]},
|
||||
{"len_eq": ["content.token", 16]},
|
||||
{"check": "status_code", "comparator": "eq", "expect": 200},
|
||||
{"sum_status_code": ["status_code", 2]},
|
||||
{"check": "content.token", "comparator": "len_eq", "expect": 16}
|
||||
]
|
||||
}
|
||||
@@ -49,6 +50,7 @@
|
||||
{"eq": ["status_code", 201]},
|
||||
{"eq": ["content.success", true]},
|
||||
{"check": "status_code", "comparator": "eq", "expect": 201},
|
||||
{"sum_status_code": ["status_code", 3]},
|
||||
{"check": "content.success", "comparator": "eq", "expect": true}
|
||||
]
|
||||
}
|
||||
@@ -73,6 +75,7 @@
|
||||
{"eq": ["status_code", 500]},
|
||||
{"eq": ["content.success", false]},
|
||||
{"check": "status_code", "comparator": "eq", "expect": 500},
|
||||
{"sum_status_code": ["status_code", 5]},
|
||||
{"check": "content.success", "comparator": "eq", "expect": false}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user