【文件属性】:
文件名称:httpassert:用于golang的http响应主体断言工具
文件大小:17KB
文件格式:ZIP
更新时间:2021-03-22 03:59:48
Go
HTTP ASSERT
用于golang的HTTP响应主体断言工具。
安装
go get github.com/zgs225/httpassert
例子
func TestSomeHTTPEndpoint ( t * testing. T ) {
req := httptest . NewRequest ( "GET" , "http://localhost/users?page=2" , nil )
res := httptest . NewRecord ()
someHttpServer . ServeHTTP ( res , req )
expected := Response {
Total : 10 ,
Current : 2 ,
Items : [] User {
{
Name : "John" ,
【文件预览】:
httpassert-main
----any.go(156B)
----compare_complex_test.go(335B)
----go.mod(45B)
----compare_map_test.go(950B)
----render_type_test.go(2KB)
----.github()
--------workflows()
----render_value_test.go(2KB)
----compare_array_like_test.go(712B)
----compare_string_test.go(344B)
----encoding.go(153B)
----equal_json.go(777B)
----compare_values.go(4KB)
----json_ecoding.go(47B)
----any_test.go(526B)
----render_json_error_test.go(1KB)
----equal_json_test.go(1KB)
----compare_int_test.go(1KB)
----README.markdown(3KB)
----LICENSE(1KB)
----types.go(165B)
----compare_struct_test.go(1KB)
----strings.go(418B)
----strings_test.go(714B)
----compare_float_test.go(436B)
----compare_bool_test.go(566B)
----.gitignore(1KB)
----render_json_error.go(4KB)
----compare_values_test.go(3KB)
----compare_uint_test.go(592B)