51Degrees Pipeline for Python

tests.test_javascriptbuilder_variables.JavaScriptBuilderVariablesTests Class Reference

Inheritance diagram for tests.test_javascriptbuilder_variables.JavaScriptBuilderVariablesTests:

[legend]

Collaboration diagram for tests.test_javascriptbuilder_variables.JavaScriptBuilderVariablesTests:

[legend]

Public Member Functions

 test_parameters_are_url_encoded (self)
 test_parameters_are_written_without_spaces (self)
 test_parameters_leave_out_session_id_and_sequence (self)
 test_url_carries_no_query_string (self)
 test_url_has_one_slash_between_host_and_endpoint (self)
 test_parameter_name_holding_a_dot_is_kept_whole (self)
 test_url_keeps_a_query_string_given_in_the_endpoint (self)
 test_refused_url_is_left_out_and_logged_once (self)
 test_refused_url_is_logged_on_one_line (self)
 test_blank_host_gives_no_callback_and_is_not_logged (self)
 test_host_from_the_request_is_written_as_checked (self)

Member Function Documentation

◆ test_blank_host_gives_no_callback_and_is_not_logged()

tests.test_javascriptbuilder_variables.JavaScriptBuilderVariablesTests.test_blank_host_gives_no_callback_and_is_not_logged ( self)
A host made only of whitespace is not set, so the script has no
callback and nothing is logged.

◆ test_host_from_the_request_is_written_as_checked()

tests.test_javascriptbuilder_variables.JavaScriptBuilderVariablesTests.test_host_from_the_request_is_written_as_checked ( self)
A host from the request reaches the script as the check writes
it, in lower case and with anything that could end the string the
script holds it in percent-encoded.

◆ test_parameter_name_holding_a_dot_is_kept_whole()

tests.test_javascriptbuilder_variables.JavaScriptBuilderVariablesTests.test_parameter_name_holding_a_dot_is_kept_whole ( self)

◆ test_parameters_are_url_encoded()

tests.test_javascriptbuilder_variables.JavaScriptBuilderVariablesTests.test_parameters_are_url_encoded ( self)
The script joins the rendered parameters into its request body
as they are, so each key and value must already be encoded, as the
.NET builder does. An unencoded '&' or '=' in a value would split
it into extra body fields, and a space would not survive.

◆ test_parameters_are_written_without_spaces()

tests.test_javascriptbuilder_variables.JavaScriptBuilderVariablesTests.test_parameters_are_written_without_spaces ( self)
The .NET builder writes the parameters object with no spaces
between the parts, so the rendered script is the same text.

◆ test_parameters_leave_out_session_id_and_sequence()

tests.test_javascriptbuilder_variables.JavaScriptBuilderVariablesTests.test_parameters_leave_out_session_id_and_sequence ( self)
Both are appended by the script itself, after it takes the record
of a request's inputs.

◆ test_refused_url_is_left_out_and_logged_once()

tests.test_javascriptbuilder_variables.JavaScriptBuilderVariablesTests.test_refused_url_is_left_out_and_logged_once ( self)
A host the check refuses gives a script with no callback, and the
refusal is logged as an error the first time only, whatever the
requests in between.

◆ test_refused_url_is_logged_on_one_line()

tests.test_javascriptbuilder_variables.JavaScriptBuilderVariablesTests.test_refused_url_is_logged_on_one_line ( self)
The URL is quoted and escaped in the log, so a line break in it
cannot start a new log line.

◆ test_url_carries_no_query_string()

tests.test_javascriptbuilder_variables.JavaScriptBuilderVariablesTests.test_url_carries_no_query_string ( self)
The callback URL is the protocol, the host and the endpoint and
nothing more, as in the .NET builder. The query values reach the
callback in the request body, through the parameters. Adding them to
the URL as well sent the session id and the sequence twice, and wrote
header and server values, such as the host and the protocol, into
the URL as if they were query values.

◆ test_url_has_one_slash_between_host_and_endpoint()

tests.test_javascriptbuilder_variables.JavaScriptBuilderVariablesTests.test_url_has_one_slash_between_host_and_endpoint ( self)
As in the .NET builder, a slash is added where neither the host
nor the endpoint has one, and one is dropped where both do.

◆ test_url_keeps_a_query_string_given_in_the_endpoint()

tests.test_javascriptbuilder_variables.JavaScriptBuilderVariablesTests.test_url_keeps_a_query_string_given_in_the_endpoint ( self)
A query string the integrator put in the endpoint setting is
part of the endpoint and is kept as given.