Created
October 28, 2011 21:06
-
-
Save mgood/1323560 to your computer and use it in GitHub Desktop.
dalton capturing
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
import dalton | |
dalton.inject() | |
from httplib import HTTPConnection | |
recorder = dalton.Recorder(caller=HTTPConnection('www.google.com')) | |
def test(): | |
h = HTTPConnection('www.google.com') | |
h.request('GET', '/') | |
resp = h.getresponse() | |
body = resp.read() | |
assert body.startswith('<!doctype html>') | |
with recorder.recording(): | |
test() | |
recorder.save('google') | |
player = dalton.Player(caller=HTTPConnection('www.google.com'), playback_dir='google') | |
with player.playing(): | |
test() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment