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 5908509
Showing 1 changed file with 13 additions and 0 deletions.
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 5908509

Please sign in to comment.