Skip to content

Commit 23c05f9

Browse files
committed
Add test for curl debug mixin without OAuth
Added test case for the fallback path in CurlDebugMixin when OAuth token is not available, ensuring 100% test coverage for the mixin class.
1 parent 5bd293b commit 23c05f9

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/utils/test_curl_debug_mixin.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,19 @@ def test_debug_mode_integration(capsys):
116116
assert "test/endpoint" in captured.out
117117
assert "param1=value1" in captured.out
118118
assert "test_token" in captured.out
119+
120+
121+
def test_build_curl_command_without_oauth():
122+
"""Test curl command generation when oauth is not available"""
123+
# Create a bare mixin instance without oauth
124+
mixin = CurlDebugMixin()
125+
126+
# Generate a curl command
127+
result = mixin._build_curl_command(
128+
url="https://api.fitbit.com/1/user/-/test.json", http_method="GET"
129+
)
130+
131+
# Verify that the fallback auth header is used
132+
assert '-H "Authorization: Bearer TOKEN"' in result
133+
assert "curl -v" in result
134+
assert "'https://api.fitbit.com/1/user/-/test.json'" in result

0 commit comments

Comments
 (0)