test(gateway): fix meck unload error and reformat some codes
This commit is contained in:
parent
786be82d07
commit
7f1bec5d78
|
@ -136,8 +136,8 @@ on_start_auth(authn_http) ->
|
|||
|
||||
%% set handler for test server
|
||||
Handler = fun(Req0, State) ->
|
||||
ct:pal("Authn Req:~p~nState:~p~n", [Req0, State]),
|
||||
case cowboy_req:match_qs([username, password], Req0) of
|
||||
ct:pal("Authn Req:~p~nState:~p~n", [Req0, State]),
|
||||
case cowboy_req:match_qs([username, password], Req0) of
|
||||
#{
|
||||
username := <<"admin">>,
|
||||
password := <<"public">>
|
||||
|
@ -154,8 +154,8 @@ on_start_auth(authn_http) ->
|
|||
|
||||
on_stop_auth(authn_http) ->
|
||||
Delete = fun(Gateway) ->
|
||||
Path = io_lib:format("/gateway/~ts/authentication", [Gateway]),
|
||||
{204, _} = request(delete, Path)
|
||||
Path = io_lib:format("/gateway/~ts/authentication", [Gateway]),
|
||||
{204, _} = request(delete, Path)
|
||||
end,
|
||||
lists:foreach(Delete, ?GATEWAYS),
|
||||
ok = emqx_authn_http_test_server:stop().
|
||||
|
|
|
@ -93,11 +93,11 @@ end_per_testcase(_Case, Config) ->
|
|||
|
||||
t_case_coap(_) ->
|
||||
Login = fun(URI, Checker) ->
|
||||
Action = fun(Channel) ->
|
||||
Req = emqx_coap_SUITE:make_req(post),
|
||||
Checker(emqx_coap_SUITE:do_request(Channel, URI, Req))
|
||||
end,
|
||||
emqx_coap_SUITE:do(Action)
|
||||
Action = fun(Channel) ->
|
||||
Req = emqx_coap_SUITE:make_req(post),
|
||||
Checker(emqx_coap_SUITE:do_request(Channel, URI, Req))
|
||||
end,
|
||||
emqx_coap_SUITE:do(Action)
|
||||
end,
|
||||
Prefix = emqx_coap_SUITE:mqtt_prefix(),
|
||||
RightUrl =
|
||||
|
|
|
@ -42,6 +42,7 @@ init_per_suite(Conf) ->
|
|||
Conf.
|
||||
|
||||
end_per_suite(_Conf) ->
|
||||
meck:unload(emqx_access_control),
|
||||
ok.
|
||||
|
||||
%%--------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue