Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 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.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |