From: Kevin McCarthy Date: Tue, 4 Sep 2012 01:32:40 +0000 (-1000) Subject: Add failing test for HTTPS requests to shame me into fixing this bug X-Git-Tag: v0.1.0~75 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=e19d82aa035b7f3b6519c0986fb39258062376a5;p=vcrpy.git Add failing test for HTTPS requests to shame me into fixing this bug --- diff --git a/test.py b/test.py index 6211aaf..c2a10a5 100644 --- a/test.py +++ b/test.py @@ -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()