Skip to content

Commit

Permalink
test: use httpretty for retry test
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Bush committed Sep 27, 2023
1 parent dcd49d1 commit 6881824
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest coverage codecov
pip install pytest coverage codecov httpretty
pip install .
type python
type pip
Expand Down
13 changes: 13 additions & 0 deletions tests/tests_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
from unittest.mock import ANY, Mock, call, patch
from uuid import UUID, uuid4

import httpretty
import requests

from sypht.client import SyphtClient

from .util.mock_http_server import MockRequestHandler, MockServerSession
Expand Down Expand Up @@ -164,6 +167,16 @@ def create_request_handler(*args, **kwargs):
requests,
)

def test_pretty(self):
httpretty.enable(
verbose=True, allow_net_connect=False
) # enable HTTPretty so that it will monkey patch the socket module
httpretty.register_uri(
httpretty.GET, "http://yipit.com/", body="Find the best daily deals"
)

response = requests.get("http://yipit.com")


if __name__ == "__main__":
unittest.main()

0 comments on commit 6881824

Please sign in to comment.