@@ -41,10 +41,10 @@ def test_convert_null_header_tuples_to_dict(self):
4141 test_headers_list = None
4242 expected_headers_dict = {}
4343
44- assert self .test_api_client ._convert_list_tuples_to_dict (
45- test_headers_list ) == expected_headers_dict , (
44+ self . assertEqual ( self .test_api_client ._convert_list_tuples_to_dict (
45+ test_headers_list ), expected_headers_dict , (
4646 "DefaultApiClient failed to convert null headers list to empty "
47- "dict object" )
47+ "dict object" ))
4848
4949 def test_convert_header_tuples_to_dict (self ):
5050 test_headers_list = [
@@ -53,20 +53,20 @@ def test_convert_header_tuples_to_dict(self):
5353 expected_headers_dict = {
5454 "header_1" : "test_1, test_3" , "header_2" : "test_2" }
5555
56- assert self .test_api_client ._convert_list_tuples_to_dict (
57- test_headers_list ) == expected_headers_dict , (
56+ self . assertEqual ( self .test_api_client ._convert_list_tuples_to_dict (
57+ test_headers_list ), expected_headers_dict , (
5858 "DefaultApiClient failed to convert header list of tuples to "
5959 "dictionary format needed for http "
60- "request call" )
60+ "request call" ))
6161
6262 def test_convert_null_header_dict_to_tuples (self ):
6363 test_headers_dict = None
6464 expected_headers_list = []
6565
66- assert self .test_api_client ._convert_dict_to_list_tuples (
67- test_headers_dict ) == expected_headers_list , (
66+ self . assertEqual ( self .test_api_client ._convert_dict_to_list_tuples (
67+ test_headers_dict ), expected_headers_list , (
6868 "DefaultApiClient failed to convert null headers dict to empty "
69- "list object" )
69+ "list object" ))
7070
7171 def test_convert_header_dict_to_tuples (self ):
7272 test_headers_dict = {
@@ -76,11 +76,11 @@ def test_convert_header_dict_to_tuples(self):
7676 ("header_1" , "test_1" ), ("header_1" , "test_3" ),
7777 ("header_2" , "test_2" ), ("header_3" , "test_4" )]
7878
79- assert set (self .test_api_client ._convert_dict_to_list_tuples (
80- test_headers_dict )) == set (
79+ self . assertEqual ( set (self .test_api_client ._convert_dict_to_list_tuples (
80+ test_headers_dict )), set (
8181 expected_headers_list ), (
8282 "DefaultApiClient failed to convert headers dict to list of "
83- "tuples format for ApiClientResponse" )
83+ "tuples format for ApiClientResponse" ))
8484
8585 def test_resolve_valid_http_method (self ):
8686 with mock .patch ("requests.get" ,
@@ -104,15 +104,15 @@ def test_resolve_invalid_http_method_throw_exception(self):
104104 with self .assertRaises (ApiClientException ) as exc :
105105 self .test_api_client .invoke (test_invalid_method_request )
106106
107- assert "Invalid request method: GET_TEST" in str (exc .exception )
107+ self . assertIn ( "Invalid request method: GET_TEST" , str (exc .exception ) )
108108
109109 def test_invoke_http_method_throw_exception (self ):
110110 with mock .patch ("requests.get" ,
111111 side_effect = Exception ("test exception" )):
112112 with self .assertRaises (ApiClientException ) as exc :
113113 self .test_api_client .invoke (self .valid_request )
114114
115- assert "Error executing the request: test exception" in str (exc .exception )
115+ self . assertIn ( "Error executing the request: test exception" , str (exc .exception ) )
116116
117117 def test_api_client_invoke_with_method_headers_processed (self ):
118118 self .valid_request .headers = [
@@ -131,21 +131,21 @@ def test_api_client_invoke_with_method_headers_processed(self):
131131 side_effect = lambda * args , ** kwargs : test_response ):
132132 actual_response = self .test_api_client .invoke (self .valid_request )
133133
134- assert set (actual_response .headers ) == set ([
134+ self . assertEqual ( set (actual_response .headers ), set ([
135135 ("response_header_1" , "test_1" ),
136136 ("response_header_1" , "test_3" ),
137137 ("response_header_2" , "test_2" ),
138138 ("response_header_3" , "test_4" )]), (
139139 "Response headers from client doesn't match with the "
140- "expected headers" )
140+ "expected headers" ))
141141
142- assert actual_response .status_code == 400 , (
142+ self . assertEqual ( actual_response .status_code , 400 , (
143143 "Status code from client response doesn't match with the "
144- "expected response status code" )
144+ "expected response status code" ))
145145
146- assert actual_response .body == "test response body" , (
146+ self . assertEqual ( actual_response .body , "test response body" , (
147147 "Body from client response doesn't match with the expected "
148- "response body" )
148+ "response body" ))
149149
150150 def test_api_client_invoke_with_http_url_throw_error (self ):
151151 test_invalid_url_scheme_request = ApiClientRequest (
@@ -157,7 +157,7 @@ def test_api_client_invoke_with_http_url_throw_error(self):
157157 with self .assertRaises (ApiClientException ) as exc :
158158 self .test_api_client .invoke (test_invalid_url_scheme_request )
159159
160- assert "Requests against non-HTTPS endpoints are not allowed." in str (exc .exception )
160+ self . assertIn ( "Requests against non-HTTPS endpoints are not allowed." , str (exc .exception ) )
161161
162162 def test_api_client_invoke_with_http_case_sensitive_url_throw_error (self ):
163163 test_invalid_url_scheme_request = ApiClientRequest (
@@ -169,7 +169,7 @@ def test_api_client_invoke_with_http_case_sensitive_url_throw_error(self):
169169 with self .assertRaises (ApiClientException ) as exc :
170170 self .test_api_client .invoke (test_invalid_url_scheme_request )
171171
172- assert "Requests against non-HTTPS endpoints are not allowed." in str (exc .exception )
172+ self . assertIn ( "Requests against non-HTTPS endpoints are not allowed." , str (exc .exception ) )
173173
174174 def test_api_client_invoke_with_no_url_schema_throw_error (self ):
175175 test_invalid_url_scheme_request = ApiClientRequest (
@@ -181,7 +181,7 @@ def test_api_client_invoke_with_no_url_schema_throw_error(self):
181181 with self .assertRaises (ApiClientException ) as exc :
182182 self .test_api_client .invoke (test_invalid_url_scheme_request )
183183
184- assert "Requests against non-HTTPS endpoints are not allowed." in str (exc .exception )
184+ self . assertIn ( "Requests against non-HTTPS endpoints are not allowed." , str (exc .exception ) )
185185
186186 def test_api_client_send_request_with_raw_data_serialized_for_json_content (
187187 self ):
0 commit comments