~didrocks/unity/altf10

« back to all changes in this revision

Viewing changes to grackle/tests/test_client.py

  • Committer: Aaron Bentley
  • Date: 2012-01-10 14:03:53 UTC
  • Revision ID: aaron@canonical.com-20120110140353-njvna2100kp082s7
Use constants.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
    HTTPServer,
3
3
    BaseHTTPRequestHandler,
4
4
    )
 
5
import httplib
5
6
import os
6
7
from signal import SIGKILL
7
8
from StringIO import StringIO
35
36
    def do_POST(self):
36
37
        message = self.rfile.read(int(self.headers['content-length']))
37
38
        if message == 'This is a message':
38
 
            self.send_response(200)
 
39
            self.send_response(httplib.CREATED)
39
40
            self.end_headers()
40
41
            self.wfile.close()
41
42
        else:
42
 
            self.send_error(400)
 
43
            self.send_error(httplib.BAD_REQUEST)
43
44
 
44
45
 
45
46
def run_service():