From 4ba4521b560bf7b9f30fdb13184121f350fe99cf Mon Sep 17 00:00:00 2001 From: Ilya Kreymer Date: Fri, 23 Oct 2015 11:53:28 -0700 Subject: [PATCH] tests: use random port instead of 8080 for cli test to avoid conflicts with running services --- pywb/framework/wsgi_wrappers.py | 2 +- tests/test_auto_colls.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pywb/framework/wsgi_wrappers.py b/pywb/framework/wsgi_wrappers.py index 87237399..9dae514e 100644 --- a/pywb/framework/wsgi_wrappers.py +++ b/pywb/framework/wsgi_wrappers.py @@ -168,7 +168,7 @@ def start_wsgi_ref_server(the_app, name, port): # pragma: no cover import wsgiref.handlers wsgiref.handlers.is_hop_by_hop = lambda x: False - if not port: + if port is None: port = DEFAULT_PORT logging.info('Starting %s on port %s', name, port) diff --git a/tests/test_auto_colls.py b/tests/test_auto_colls.py index e79d1269..95538ed3 100644 --- a/tests/test_auto_colls.py +++ b/tests/test_auto_colls.py @@ -84,17 +84,18 @@ class TestManagedColls(object): test autoindex error before collections inited """ from pywb.apps.cli import wayback - wayback([]) + + wayback(['-p', '0']) # Nothing to auto-index.. yet with raises(SystemExit): - wayback(['-a']) + wayback(['-a', '-p', '0']) colls = os.path.join(self.root_dir, 'collections') os.mkdir(colls) pywb.manager.autoindex.keep_running = False - wayback(['-a']) + wayback(['-a', '-p', '0']) def test_create_first_coll(self): """ Test first collection creation, with all required dirs