Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] #52

Closed
wants to merge 2 commits into from
Closed

[WIP] #52

wants to merge 2 commits into from

Conversation

HernanRivasAcosta
Copy link
Member

No description provided.

Json = [build_field(F, Definitions) || F <- RequiredFields],

io:format("Json: ~p~n", [Json]),
R = api_call(Post, Path, [{<<"Content-Type">>, ContentType}], maps:from_list(Json)),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 31 is too long: R = api_call(Post, Path, [{<<"Content-Type">>, ContentType}], maps:from_list(Json)),.


-exports([init_per_suite/1]).

init_per_suite(Config) ->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to Compiler:

Warning: function init_per_suite/1 is unused

-module(sr_test_SUITE).

-spec method_not_allowed(any()) -> ok.
method_not_allowed(Config) ->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to Compiler:

Warning: function method_not_allowed/1 is unused

api_call(Method, Path) ->
api_call(Method, Path, []).

api_call(Method, Path, Hdrs) when is_list(Hdrs) ->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to Compiler:

Warning: missing specification for function api_call/3

advanced_tests(Handlers) ->
ok.

api_call(Method, Path) ->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to Compiler:

Warning: missing specification for function api_call/2

ok.

-spec advanced_tests([module()]) -> ok.
advanced_tests(Handlers) ->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to Compiler:

Warning: variable 'Handlers' is unused

api_call(Method, Path, Hdrs) when is_list(Hdrs) ->
api_call(Method, Path, Hdrs, <<>>).

api_call(Method, Path, Hdrs, Json) when is_map(Json) ->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to Compiler:

Warning: missing specification for function api_call/4


-mixin([{sr_test_SUITE, [method_not_allowed/1]}]).

-exports([init_per_suite/1]).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's export

api_call(Method, Path, Hdrs, jsx:encode(Json));
api_call(Method, Path, Headers, Body) ->
{ok, Application} = application:get_application(),
Port = integer_to_binary(application:get_env(Application, http_port, 8080)),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Request the port as a parameter (or the whole server name, maybe). Not all apps keep the port in the same place.

ct:fail("Couldnt ~p ~p: ~p", [Method, Path, X])
end.

%% @todo remove once inaka/sumo_rest#44 is fixed
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's fixed already. Check #44

Json = [build_field(F, Definitions) || F <- RequiredFields],

io:format("Json: ~p~n", [Json]),
R = api_call(Post, Path, [{<<"Content-Type">>, ContentType}], maps:from_list(Json)),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 31 is too long: R = api_call(Post, Path, [{<<"Content-Type">>, ContentType}], maps:from_list(Json)),.

@elbrujohalcon elbrujohalcon deleted the hernan.50.tests_suites branch May 15, 2018 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants