Skip to content

Commit

Permalink
Add first test for wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
Aengus Walton authored and Aengus Walton committed Sep 13, 2016
1 parent 46d6412 commit 9f87417
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/test_wrapper.py
@@ -0,0 +1,17 @@
import httpretty
import mock

from httsleep import HttSleeper

URL = 'http://example.com'


@httpretty.activate
def test_wrapper():
"""Should create a HttSleeper and return its run() return value"""
httpretty.register_uri(httpretty.GET, URL, body='<html></html>', status=200)
with mock.patch('httsleep.main.sleep') as mock_sleep:
httsleep = HttSleeper(URL, {'status_code': 200})
resp = httsleep.run()
assert resp.status_code == 200
assert not mock_sleep.called

0 comments on commit 9f87417

Please sign in to comment.