~didrocks/unity/altf10

« back to all changes in this revision

Viewing changes to grackle/client.py

  • Committer: Aaron Bentley
  • Date: 2012-01-10 13:46:48 UTC
  • Revision ID: aaron@canonical.com-20120110134648-q991pmjj9jc05mr2
Actual fake service working.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
    connection = HTTPConnection('localhost', 8435)
5
5
    connection.request('POST', 'foo', file_obj.read())
6
6
    response = connection.getresponse()
7
 
    print response.status, response.reason
8
7
    data = response.read()
9
 
    print data
 
8
    if response.status == 400:
 
9
        raise Exception('wtf')
 
10
    elif response.status == 200:
 
11
        return
 
12
    else:
 
13
        raise Exception('!!')