1
0
mirror of https://github.com/kevin1024/vcrpy.git synced 2025-12-09 01:03:24 +00:00

Add failing test for HTTPS requests to shame me into fixing this bug

This commit is contained in:
Kevin McCarthy
2012-09-03 15:32:40 -10:00
parent 5e05587ea0
commit e19d82aa03

21
test.py
View File

@@ -150,6 +150,27 @@ class TestRequestsPost(unittest.TestCase):
def test_cached_post_response_text(self):
self.assertEqual(self.unmolested_response.text, self.cached_response.text)
class TestRequestsHTTPS(unittest.TestCase):
def setUp(self):
self.unmolested_response = requests.get('https://github.com')
with vcr.use_cassette(TEST_CASSETTE_FILE):
self.initial_response = requests.get('https://github.com')
self.cached_response = requests.get('https://github.com')
def tearDown(self):
try:
os.remove(TEST_CASSETTE_FILE)
except OSError:
pass
def test_initial_https_response_text(self):
self.assertEqual(self.unmolested_response.text, self.initial_response.text)
def test_cached_https_response_text(self):
self.assertEqual(self.unmolested_response.text, self.cached_response.text)
if __name__ == '__main__':
unittest.main()