Beispiel #1
0
    def test_header(self):
        response = HttpResponse(self.sock)
        response.begin()

        self.assertEquals(200, response.status)
        self.assertEquals('OK', response.reason)

        headers = list(map(lambda (x, y): x, response.getheaders()))
        self.assertIn('date', headers)
        self.assertIn('connection', headers)
Beispiel #2
0
    def test_header(self):
        response = HttpResponse(self.sock)
        response.begin()

        self.assertEquals(200, response.status)
        self.assertEquals('OK', response.reason)

        headers = list(map(lambda (x,y): x, response.getheaders()))
        self.assertIn('date', headers)
        self.assertIn('connection', headers)
Beispiel #3
0
    def test_raw_read(self):
        response = HttpResponse(self.sock)
        response.begin()

        all_data = ''
        while True:
            data = response.read(raw=True)
            if not data:
                break
            all_data += data
        self.assertEquals(''.join(self.RAW_DATA).strip(), all_data)
Beispiel #4
0
    def test_raw_read(self):
        response = HttpResponse(self.sock)
        response.begin()

        all_data = ''
        while True:
            data = response.read(raw=True)
            if not data:
                break
            all_data += data
        self.assertEquals(''.join(self.RAW_DATA).strip(), all_data)
Beispiel #5
0
    def test_normal_read(self):
        response = HttpResponse(self.sock)
        response.begin()

        data = response.read()
        self.assertEquals(self.HTML_DATA, data)
Beispiel #6
0
    def test_normal_read(self):
        response = HttpResponse(self.sock)
        response.begin()

        data = response.read()
        self.assertEquals(self.HTML_DATA, data)