mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-24 06:59:52 +01:00
tests: use random port instead of 8080 for cli test to avoid conflicts with running services
This commit is contained in:
parent
e37636de84
commit
4ba4521b56
@ -168,7 +168,7 @@ def start_wsgi_ref_server(the_app, name, port): # pragma: no cover
|
|||||||
import wsgiref.handlers
|
import wsgiref.handlers
|
||||||
wsgiref.handlers.is_hop_by_hop = lambda x: False
|
wsgiref.handlers.is_hop_by_hop = lambda x: False
|
||||||
|
|
||||||
if not port:
|
if port is None:
|
||||||
port = DEFAULT_PORT
|
port = DEFAULT_PORT
|
||||||
|
|
||||||
logging.info('Starting %s on port %s', name, port)
|
logging.info('Starting %s on port %s', name, port)
|
||||||
|
@ -84,17 +84,18 @@ class TestManagedColls(object):
|
|||||||
test autoindex error before collections inited
|
test autoindex error before collections inited
|
||||||
"""
|
"""
|
||||||
from pywb.apps.cli import wayback
|
from pywb.apps.cli import wayback
|
||||||
wayback([])
|
|
||||||
|
wayback(['-p', '0'])
|
||||||
|
|
||||||
# Nothing to auto-index.. yet
|
# Nothing to auto-index.. yet
|
||||||
with raises(SystemExit):
|
with raises(SystemExit):
|
||||||
wayback(['-a'])
|
wayback(['-a', '-p', '0'])
|
||||||
|
|
||||||
colls = os.path.join(self.root_dir, 'collections')
|
colls = os.path.join(self.root_dir, 'collections')
|
||||||
os.mkdir(colls)
|
os.mkdir(colls)
|
||||||
|
|
||||||
pywb.manager.autoindex.keep_running = False
|
pywb.manager.autoindex.keep_running = False
|
||||||
wayback(['-a'])
|
wayback(['-a', '-p', '0'])
|
||||||
|
|
||||||
def test_create_first_coll(self):
|
def test_create_first_coll(self):
|
||||||
""" Test first collection creation, with all required dirs
|
""" Test first collection creation, with all required dirs
|
||||||
|
Loading…
x
Reference in New Issue
Block a user