Fix test_brozzling::httpd fixture

We used `self.headers.getheader` which no longer works. We replace it
with `self.headers.get`.

We change the code to write binary data to `self.wfile` because we get
an exception for writing str and/or None.
This commit is contained in:
Vangelis Banos 2019-05-14 16:29:52 +00:00
parent ee8ef23f0c
commit a1f9122317

View File

@ -67,8 +67,8 @@ def httpd(request):
self.send_header('WWW-Authenticate', 'Basic realm=\"Test\"')
self.send_header('Content-type', 'text/html')
self.end_headers()
self.wfile.write(self.headers.getheader('Authorization'))
self.wfile.write('not authenticated')
self.wfile.write(self.headers.get('Authorization', b''))
self.wfile.write(b'not authenticated')
else:
super().do_GET()