Skip to content

Replace broken httpretty tests with mock (SC-324)#973

Merged
blackboxsw merged 3 commits into
canonical:mainfrom
TheRealFalcon:fix-unit-tests
Aug 13, 2021
Merged

Replace broken httpretty tests with mock (SC-324)#973
blackboxsw merged 3 commits into
canonical:mainfrom
TheRealFalcon:fix-unit-tests

Conversation

@TheRealFalcon
Copy link
Copy Markdown
Contributor

Proposed Commit Message

Replace broken httpretty tests with mock

Certain versions of python/httpretty don't work correctly using https
URIs. #960 recently added httpretty tests using https. This commit
replaces the httpretty tests that were failing on https with mocks of
readurl instead.

Additional Context

This was found by running packages/bddeb on main.

The root cause has been open for 6 years now (and has affected other parts of the code base), so we may want to migrate to responses at some point in the future.

Test Steps

Checklist:

  • My code follows the process laid out in the documentation
  • I have updated or added any unit tests accordingly
  • I have updated or added any documentation accordingly

Certain versions of python/httpretty don't work correctly using https
URIs. canonical#960 recently added httpretty tests using https. This commit
replaces the httpretty tests that were failing on https with mocks of
readurl instead.
@TheRealFalcon TheRealFalcon changed the title Replace broken httpretty tests with mock Replace broken httpretty tests with mock (SC-324) Aug 12, 2021
Copy link
Copy Markdown
Contributor

@paride paride left a comment

Choose a reason for hiding this comment

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

The code LGTM and I verified that the tests pass with this merged.

Copy link
Copy Markdown
Collaborator

@blackboxsw blackboxsw left a comment

Choose a reason for hiding this comment

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

LGTM!

@blackboxsw blackboxsw merged commit 1c3b10b into canonical:main Aug 13, 2021
@TheRealFalcon TheRealFalcon deleted the fix-unit-tests branch March 21, 2025 18:47
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.

3 participants