@@ -299,9 +299,13 @@ def test_handle_json_response_with_invalid_json(base_resource, mock_logger):
299299def test_make_request_json_success (base_resource , mock_oauth_session , mock_response_factory ):
300300 """Test successful JSON request"""
301301 expected_data = {"success" : True }
302+ < << << << Updated upstream
302303 mock_response = mock_response_factory (
303304 200 , expected_data , headers = {"content-type" : "application/json" }
304305 )
306+ == == == =
307+ mock_response = mock_response_factory (200 , expected_data , headers = {"content-type" : "application/json" })
308+ >> >> >> > Stashed changes
305309 mock_oauth_session .request .return_value = mock_response
306310
307311 result = base_resource ._make_request ("test/endpoint" )
@@ -320,9 +324,15 @@ def test_make_request_no_content(base_resource, mock_oauth_session, mock_respons
320324def test_make_request_xml_response (base_resource , mock_oauth_session , mock_response_factory ):
321325 """Test XML response handling"""
322326 mock_response = mock_response_factory (
327+ << << << < Updated upstream
323328 200 ,
324329 headers = {"content-type" : "application/vnd.garmin.tcx+xml" },
325330 content_type = "application/vnd.garmin.tcx+xml" ,
331+ == == == =
332+ 200 ,
333+ headers = {"content-type" : "application/vnd.garmin.tcx+xml" },
334+ content_type = "application/vnd.garmin.tcx+xml"
335+ >> >> >> > Stashed changes
326336 )
327337 mock_response .text = "<test>data</test>"
328338 mock_oauth_session .request .return_value = mock_response
@@ -331,12 +341,21 @@ def test_make_request_xml_response(base_resource, mock_oauth_session, mock_respo
331341 assert result == "<test>data</test>"
332342
333343
344+ << << << < Updated upstream
334345def test_make_request_unexpected_content_type (
335346 base_resource , mock_oauth_session , mock_response_factory
336347):
337348 """Test handling of unexpected content type"""
338349 mock_response = mock_response_factory (
339350 200 , headers = {"content-type" : "text/plain" }, content_type = "text/plain"
351+ == == == =
352+ def test_make_request_unexpected_content_type (base_resource , mock_oauth_session , mock_response_factory ):
353+ """Test handling of unexpected content type"""
354+ mock_response = mock_response_factory (
355+ 200 ,
356+ headers = {"content-type" : "text/plain" },
357+ content_type = "text/plain"
358+ >> > >> >> Stashed changes
340359 )
341360 mock_response .text = "some data"
342361 mock_oauth_session .request .return_value = mock_response
@@ -619,8 +638,14 @@ def test_make_direct_request_with_debug(mock_build_curl, mock_print, base_resour
619638 # Verify the curl command was built correctly
620639 mock_build_curl .assert_called_once_with ("https://api.fitbit.com/test" , "GET" )
621640
622- # Verify print was called with the right message pattern
623- mock_print .assert_any_call ("\n # Debug curl command for test_pagination (pagination):" )
641+ # Verify security warning messages were printed
642+ mock_print .assert_any_call (
643+ "\n # DEBUG MODE: Security Warning - contains authentication tokens!"
644+ )
645+ mock_print .assert_any_call (
646+ "# See docs/SECURITY.md for guidance on sharing this output safely."
647+ )
648+ mock_print .assert_any_call ("# Debug curl command for test_pagination (pagination):" )
624649
625650
626651@patch ("fitbit_client.resources._base.BaseResource._handle_json_response" )
0 commit comments