Exemplo n.º 1
0
 def test_recording(self):
     replaylib.start_playback(TEST_FILENAME)
     webf = urllib.urlopen('http://localhost:%d' % servers.PORT)
     fake = webf.read()
     webf.close()
     replaylib.stop_playback()
     assert fake == compare
Exemplo n.º 2
0
    def test_with_file(self):
        replaylib.start_record()
        real = self._grab()
        replaylib.stop_record(TEST_FILENAME)
        replaylib.start_playback(TEST_FILENAME)
        fake = self._grab()
        replaylib.stop_playback()

        assert real == fake
Exemplo n.º 3
0
 def begin(self):
     if self.playback_filename:
         replaylib.start_playback(self.playback_filename)
     else:
         replaylib.start_record()