Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 5
0
    def test_normal_read(self):
        response = HttpResponse(self.sock)
        response.begin()

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

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