robot框架json验证程序库
robotframework-jsonvalidator的Python项目详细描述
简短说明
Robot Framework基于jsonschema的json验证库, jsonpath,jsonselect.
其他信息
安装
使用pip从pypi安装库:
pip install robotframework-jsonvalidator
文档
请参阅GitHub上jsonvalidator库的关键字文档。
示例
json_example.json
{ "store": { "book": [ { "category": "reference", "author": "Nigel Rees", "title": "Sayings of the Century", "price": 8.95 }, { "category": "fiction", "author": "Evelyn Waugh", "title": "Sword of Honour", "price": 12.99 }, { "category": "fiction", "author": "Herman Melville", "title": "Moby Dick", "isbn": "0-553-21311-3", "price": 8.99 }, { "category": "fiction", "author": "J. R. R. Tolkien", "title": "The Lord of the Rings", "isbn": "0-395-19395-8", "price": 22.99 } ], "bicycle": { "color": "red", "price": 19.95 } } }
robot框架测试用例:
*** Settings ***LibraryJsonValidatorLibraryOperatingSystem*** Test Cases ***Check Element ${json_example}= OperatingSystem.Get File ${CURDIR}${/}json_example.jsonElement should exist ${json_example} .author:contains("Evelyn Waugh")
许可证
apache许可证2.0