-
-
Notifications
You must be signed in to change notification settings - Fork 278
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
1 parent
0b74a86
commit 03b74fb
Showing
2 changed files
with
30 additions
and
2 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
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,29 @@ | ||
import requests | ||
import httpretty | ||
from httpretty.errors import UnmockedError | ||
|
||
from unittest import skip | ||
from sure import expect | ||
|
||
|
||
@httpretty.activate(allow_net_connect=True) | ||
def test_latest_requests(): | ||
"#425 - httpretty.latest_requests() can be called multiple times" | ||
httpretty.register_uri(httpretty.GET, 'http://google.com/', body="Not Google") | ||
httpretty.register_uri(httpretty.GET, 'https://google.com/', body="Not Google") | ||
|
||
requests.get('http://google.com/') | ||
httpretty.latest_requests()[-1].url.should.equal('http://google.com/') | ||
requests.get('https://google.com/') | ||
httpretty.latest_requests()[-1].url.should.equal('https://google.com/') | ||
|
||
httpretty.latest_requests().should.have.length_of(2) | ||
httpretty.latest_requests()[-1].url.should.equal('https://google.com/') | ||
|
||
requests.get('https://google.com/') | ||
httpretty.latest_requests().should.have.length_of(3) | ||
httpretty.latest_requests()[-1].url.should.equal('https://google.com/') | ||
|
||
requests.get('http://google.com/') | ||
httpretty.latest_requests().should.have.length_of(4) | ||
httpretty.latest_requests()[-1].url.should.equal('http://google.com/') |