mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Output stderr from curl when test fails
This commit is contained in:
parent
29dbdcdb69
commit
9dcf1ba2e0
@ -234,11 +234,11 @@ class TestAuth(BaseTest):
|
||||
curl = shutil.which('curl')
|
||||
if curl:
|
||||
def docurl(data, *args):
|
||||
cmd = [curl] + list(args) + ['http://localhost:%d/closed' % server.address[1]]
|
||||
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)
|
||||
x = p.stdout.read()
|
||||
cmd = [curl, '--silent'] + list(args) + ['http://localhost:%d/closed' % server.address[1]]
|
||||
p = subprocess.Popen(cmd, stdin=subprocess.DEVNULL, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
stdout, stderr = p.communicate()
|
||||
p.wait()
|
||||
self.ae(x, data)
|
||||
self.ae(stdout, data, f'stderr:\n{stderr.decode(errors="replace")}')
|
||||
docurl(b'')
|
||||
docurl(b'', '--digest', '--user', 'xxxx:testpw')
|
||||
docurl(b'', '--digest', '--user', 'testuser:xtestpw')
|
||||
|
Loading…
x
Reference in New Issue
Block a user