Skip to content

fixed issue with getting mock fitness usage data#389

Closed
minghansun1 wants to merge 1 commit into
masterfrom
minghan/fix-fitness-usage-request
Closed

fixed issue with getting mock fitness usage data#389
minghansun1 wants to merge 1 commit into
masterfrom
minghan/fix-fitness-usage-request

Conversation

@minghansun1
Copy link
Copy Markdown
Contributor

No description provided.

"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 "
+ "(KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36",
}
session.get(url, params=params, headers=headers)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This works for me in Postman, running the request once. Seems a bit excessive to create a session to store cookies on the first request unless absolutely necessary.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

headers = {
  'Accept': 'application/json',
  'Host': 'goboardapi.azurewebsites.net'
}

These are the only headers I need in postman to get a JSON response

@jonathanmelitski
Copy link
Copy Markdown
Contributor

jonathanmelitski commented Feb 2, 2026

regarding why tests are failing: The mock data is failing to be injected specifically in the test cases because they only inject on request.get. See line 206 of tests/penndata/test_views.py

I advise revising the test case to mock the data when using requests.Session() object (I don't know how to do this). Or go back to requests.get (which I mentioned above might be an option given the correct headers).

@minghansun1

@minghansun1 minghansun1 closed this Feb 8, 2026
@minghansun1
Copy link
Copy Markdown
Contributor Author

mistake on my end

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.

2 participants