Пример #1
0
    def test_multiple_requests(self):
        body1 = urllib2.urlopen('http://httpbin.org/').read()
        body2 = urllib2.urlopen('http://httpbin.org/get').read()
        with vcr.use_cassette(TEST_CASSETTE_FILE):
            self.assertEqual(body1, urllib2.urlopen('http://httpbin.org/').read())
            new_body2 = urllib2.urlopen('http://httpbin.org/get').read()
            
            assert_httpbin_responses_equal(body2, new_body2)

            self.assertEqual(body1, urllib2.urlopen('http://httpbin.org/').read())
            new_body2 = urllib2.urlopen('http://httpbin.org/get').read()

            assert_httpbin_responses_equal(body2, new_body2)
Пример #2
0
 def test_cached_post_response_text(self):
     assert_httpbin_responses_equal(self.unmolested_response.text, self.cached_response.text)
Пример #3
0
 def test_initial_post_response_text(self):
     assert_httpbin_responses_equal(self.unmolested_response.text, self.initial_response.text)