~unity-2d-team/unity-2d/Shell-MultiMonitor

« back to all changes in this revision

Viewing changes to grackle/tests/test_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:
2
2
    HTTPServer,
3
3
    BaseHTTPRequestHandler,
4
4
    )
5
 
import httplib
6
5
import os
7
6
from signal import SIGKILL
8
7
from StringIO import StringIO
36
35
    def do_POST(self):
37
36
        message = self.rfile.read(int(self.headers['content-length']))
38
37
        if message == 'This is a message':
39
 
            self.send_response(httplib.CREATED)
 
38
            self.send_response(200)
40
39
            self.end_headers()
41
40
            self.wfile.close()
42
41
        else:
43
 
            self.send_error(httplib.BAD_REQUEST)
 
42
            self.send_error(400)
44
43
 
45
44
 
46
45
def run_service():