1
0
mirror of https://github.com/webrecorder/pywb.git synced 2025-03-15 00:03:28 +01:00

tests: use random port instead of 8080 for cli test to avoid conflicts with running services

This commit is contained in:
Ilya Kreymer 2015-10-23 11:53:28 -07:00
parent e37636de84
commit 4ba4521b56
2 changed files with 5 additions and 4 deletions

View File

@ -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)

View File

@ -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