def test_session_unicode(self): r1 = http( "--session=test", "--auth", u"test:" + UNICODE, "GET", httpbin("/get"), u"Test:%s" % UNICODE, env=self.env() ) assert HTTP_OK in r1 r2 = http("--session=test", "GET", httpbin("/get"), env=self.env()) assert HTTP_OK in r2 assert r2.json["headers"]["Authorization"] == HTTPBasicAuth.make_header(u"test", UNICODE) assert r2.json["headers"]["Test"] == UNICODE
def test_session_unicode(self): r1 = http('--session=test', '--auth', u'test:' + UNICODE, 'GET', httpbin('/get'), u'Test:%s' % UNICODE, env=self.env()) assert HTTP_OK in r1 r2 = http('--session=test', 'GET', httpbin('/get'), env=self.env()) assert HTTP_OK in r2 assert (r2.json['headers']['Authorization'] == HTTPBasicAuth.make_header(u'test', UNICODE)) assert r2.json['headers']['Test'] == UNICODE
def test_session_unicode(self): UNICODE = u'太陽' r1 = http('--session=test', '--auth', u'test:' + UNICODE, 'GET', httpbin('/get'), u'Test:%s' % UNICODE, env=self.env()) assert HTTP_OK in r1 r2 = http('--session=test', 'GET', httpbin('/get'), env=self.env()) assert HTTP_OK in r2 assert (r2.json['headers']['Authorization'] == HTTPBasicAuth.make_header(u'test', UNICODE)) assert r2.json['headers']['Test'] == UNICODE
def test_session_unicode(self, httpbin): self.start_session(httpbin) r1 = http('--session=test', u'--auth=test:' + UNICODE, 'GET', httpbin.url + '/get', u'Test:%s' % UNICODE, env=self.env()) assert HTTP_OK in r1 r2 = http('--session=test', '--verbose', 'GET', httpbin.url + '/get', env=self.env()) assert HTTP_OK in r2 # FIXME: Authorization *sometimes* is not present on Python3 assert (r2.json['headers']['Authorization'] == HTTPBasicAuth.make_header(u'test', UNICODE)) # httpbin doesn't interpret utf8 headers assert UNICODE in r2
def test_session_unicode(self): r1 = http('--session=test', '--auth', u'test:' + UNICODE, 'GET', httpbin('/get'), u'Test:%s' % UNICODE, env=self.env()) assert HTTP_OK in r1 r2 = http('--session=test', '--verbose', 'GET', httpbin('/get'), env=self.env()) assert HTTP_OK in r2 assert ( r2.json['headers']['Authorization'] == HTTPBasicAuth.make_header( u'test', UNICODE)) # httpbin doesn't interpret utf8 headers assert UNICODE in r2