test: API return code section
This commit is contained in:
parent
b3f9220d02
commit
dcc5ae0642
|
@ -88,7 +88,7 @@ do_request_api(Method, Request)->
|
||||||
{error, socket_closed_remotely} ->
|
{error, socket_closed_remotely} ->
|
||||||
{error, socket_closed_remotely};
|
{error, socket_closed_remotely};
|
||||||
{ok, {{"HTTP/1.1", Code, _}, _, Return} }
|
{ok, {{"HTTP/1.1", Code, _}, _, Return} }
|
||||||
when Code =:= 200 orelse Code =:= 201 ->
|
when Code >= 200 andalso Code =< 299 ->
|
||||||
{ok, Return};
|
{ok, Return};
|
||||||
{ok, {Reason, _, _}} ->
|
{ok, {Reason, _, _}} ->
|
||||||
{error, Reason}
|
{error, Reason}
|
||||||
|
|
|
@ -60,7 +60,7 @@ t_crud_rule_api(_Config) ->
|
||||||
?assertEqual(Rule3, Rule2),
|
?assertEqual(Rule3, Rule2),
|
||||||
?assertEqual(<<"select * from \"t/b\"">>, maps:get(sql, Rule3)),
|
?assertEqual(<<"select * from \"t/b\"">>, maps:get(sql, Rule3)),
|
||||||
|
|
||||||
?assertMatch({200}, emqx_rule_engine_api:crud_rules_by_id(delete,
|
?assertMatch({204}, emqx_rule_engine_api:crud_rules_by_id(delete,
|
||||||
#{bindings => #{id => RuleID}})),
|
#{bindings => #{id => RuleID}})),
|
||||||
|
|
||||||
%ct:pal("Show After Deleted: ~p", [NotFound]),
|
%ct:pal("Show After Deleted: ~p", [NotFound]),
|
||||||
|
|
Loading…
Reference in New Issue