Skip to content

Commit

Permalink
Bump owslib from 0.17.1 to 0.18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
afabiani committed Jul 18, 2019
1 parent 7debf3e commit 73e983c
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 55 deletions.
26 changes: 16 additions & 10 deletions geonode/upload/tests/integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def upload_step(step=None):
return step


def get_wms(version='1.1.1', type_name=None):
def get_wms(version='1.1.1', type_name=None, username=None, password=None):
""" Function to return an OWSLib WMS object """
# right now owslib does not support auth for get caps
# requests. Either we should roll our own or fix owslib
Expand All @@ -101,12 +101,15 @@ def get_wms(version='1.1.1', type_name=None):
else:
url = GEOSERVER_URL + \
'wms?request=getcapabilities'
return WebMapService(
url,
version=version,
username=GEOSERVER_USER,
password=GEOSERVER_PASSWD
)
if username and password:
return WebMapService(
url,
version=version,
username=username,
password=password
)
else:
return WebMapService(url)


class Client(object):
Expand Down Expand Up @@ -367,7 +370,8 @@ def check_layer_geoserver_caps(self, type_name):
""" Check that a layer shows up in GeoServer's get
capabilities document """
# using owslib
wms = get_wms(type_name=type_name)
wms = get_wms(
type_name=type_name, username=GEOSERVER_USER, password=GEOSERVER_PASSWD)
ws, layer_name = type_name.split(':')
self.assertTrue(layer_name in wms.contents,
'%s is not in %s' % (layer_name, wms.contents))
Expand Down Expand Up @@ -767,7 +771,8 @@ def test_time(self):

url = urllib.unquote(url)
self.check_layer_complete(url, layer_name)
wms = get_wms(type_name='geonode:%s' % layer_name)
wms = get_wms(
type_name='geonode:%s' % layer_name, username=GEOSERVER_USER, password=GEOSERVER_PASSWD)
layer_info = wms.items()[0][1]
self.assertEquals(100, len(layer_info.timepositions))
else:
Expand Down Expand Up @@ -830,7 +835,8 @@ def get_wms_timepositions():

url = urllib.unquote(url)
self.check_layer_complete(url, layer_name)
wms = get_wms(type_name='geonode:%s' % layer_name)
wms = get_wms(
type_name='geonode:%s' % layer_name, username=GEOSERVER_USER, password=GEOSERVER_PASSWD)
layer_info = wms.items()[0][1]
self.assertEquals(100, len(layer_info.timepositions))
else:
Expand Down
84 changes: 40 additions & 44 deletions pavement.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,10 +368,10 @@ def win_install_deps(options):
print "Windows dependencies now complete. Run pip install -e geonode --use-mirrors"


@task
@cmdopts([
('version=', 'v', 'Legacy GeoNode version of the existing database.')
])
@task
def upgradedb(options):
"""
Add 'fake' data migrations for existing tables from legacy GeoNode versions
Expand All @@ -392,7 +392,7 @@ def updategeoip(options):
Update geoip db
"""
settings = options.get('settings', '')
if settings:
if settings and 'DJANGO_SETTINGS_MODULE' not in settings:
settings = 'DJANGO_SETTINGS_MODULE=%s' % settings

sh("%s python -W ignore manage.py updategeoip -o" % settings)
Expand All @@ -407,7 +407,7 @@ def sync(options):
Run the migrate and migrate management commands to create and migrate a DB
"""
settings = options.get('settings', '')
if settings:
if settings and 'DJANGO_SETTINGS_MODULE' not in settings:
settings = 'DJANGO_SETTINGS_MODULE=%s' % settings

sh("%s python -W ignore manage.py makemigrations --noinput" % settings)
Expand Down Expand Up @@ -491,7 +491,7 @@ def package(options):
('foreground', 'f', 'Do not run in background but in foreground'),
('settings=', 's', 'Specify custom DJANGO_SETTINGS_MODULE')
], share_with=['start_django', 'start_geoserver'])
def start():
def start(options):
"""
Start GeoNode (Django, GeoServer & Client)
"""
Expand All @@ -500,7 +500,7 @@ def start():


@task
def stop_django():
def stop_django(options):
"""
Stop the GeoNode Django application
"""
Expand All @@ -510,7 +510,7 @@ def stop_django():


@task
def stop_geoserver():
def stop_geoserver(options):
"""
Stop GeoServer
"""
Expand Down Expand Up @@ -552,7 +552,7 @@ def stop_geoserver():
@cmdopts([
('qgis_server_port=', 'p', 'The port of the QGIS Server instance.')
])
def stop_qgis_server():
def stop_qgis_server(options):
"""
Stop QGIS Server Backend.
"""
Expand All @@ -575,26 +575,26 @@ def stop_qgis_server():
'stop_geoserver',
'stop_qgis_server'
])
def stop():
def stop(options):
"""
Stop GeoNode
"""
# windows needs to stop the geoserver first b/c we can't tell which python
# is running, so we kill everything
info("Stopping GeoNode ...")
stop_django()
stop_django(options)


@task
@cmdopts([
('bind=', 'b', 'Bind server to provided IP address and port number.')
])
@task
def start_django():
def start_django(options):
"""
Start the GeoNode Django application
"""
settings = options.get('settings', '')
if settings:
if settings and 'DJANGO_SETTINGS_MODULE' not in settings:
settings = 'DJANGO_SETTINGS_MODULE=%s' % settings
bind = options.get('bind', '0.0.0.0:8000')
foreground = '' if options.get('foreground', False) else '&'
Expand Down Expand Up @@ -623,21 +623,22 @@ def start_django():
sh('%s python -W ignore manage.py runmessaging %s' % (settings, foreground))


def start_messaging():
@task
def start_messaging(options):
"""
Start the GeoNode messaging server
"""
settings = options.get('settings', '')
if settings:
if settings and 'DJANGO_SETTINGS_MODULE' not in settings:
settings = 'DJANGO_SETTINGS_MODULE=%s' % settings
foreground = '' if options.get('foreground', False) else '&'
sh('%s python -W ignore manage.py runmessaging %s' % (settings, foreground))


@task
@cmdopts([
('java_path=', 'j', 'Full path to java install for Windows')
])
@task
def start_geoserver(options):
"""
Start GeoServer with GeoNode extensions
Expand Down Expand Up @@ -769,7 +770,7 @@ def start_geoserver(options):
@cmdopts([
('qgis_server_port=', 'p', 'The port of the QGIS Server instance.')
])
def start_qgis_server():
def start_qgis_server(options):
"""Start QGIS Server instance with GeoNode related plugins."""
# only start if using QGIS Serrver backend
_backend = os.environ.get('BACKEND', OGC_SERVER['default']['BACKEND'])
Expand Down Expand Up @@ -818,14 +819,13 @@ def test(options):
@cmdopts([
('local=', 'l', 'Set to True if running bdd tests locally')
])
def test_bdd():
def test_bdd(options):
"""
Run GeoNode's BDD Test Suite
"""
local = str2bool(options.get('local', 'false'))
if local:
call_task('reset_hard')
call_task('setup')
else:
call_task('reset')
call_task('setup')
Expand Down Expand Up @@ -858,19 +858,13 @@ def test_integration(options):
if _backend == 'geonode.geoserver' or 'geonode.qgis_server' not in INSTALLED_APPS:
call_task('stop_geoserver')
_reset()
# Start GeoServer
call_task('start_geoserver')
else:
call_task('stop_qgis_server')
_reset()
# Start QGis Server
call_task('start_qgis_server')

sh('sleep 30')

name = options.get('name', 'geonode.tests.integration')
settings = options.get('settings', '')
if not settings and name == 'geonode.upload.tests.integration':
if name == 'geonode.upload.tests.integration':
if _django_11:
sh("cp geonode/upload/tests/test_settings.py geonode/")
settings = 'geonode.test_settings'
Expand All @@ -879,35 +873,38 @@ def test_integration(options):

success = False
try:
call_task('setup', options={'settings': settings})

if name == 'geonode.tests.csw':
call_task('sync', options={'settings': settings})
call_task('start', options={'settings': settings})
call_task('setup_data', options={'settings': settings})

settings = 'DJANGO_SETTINGS_MODULE=%s' % settings if settings else ''

if name == 'geonode.upload.tests.integration':
sh("%s python -W ignore manage.py makemigrations --noinput" % settings)
sh("%s python -W ignore manage.py migrate --noinput" % settings)
sh("%s python -W ignore manage.py loaddata sample_admin.json" % settings)
sh("%s python -W ignore manage.py loaddata geonode/base/fixtures/default_oauth_apps.json" %
sh("DJANGO_SETTINGS_MODULE=%s python -W ignore manage.py makemigrations --noinput" % settings)
sh("DJANGO_SETTINGS_MODULE=%s python -W ignore manage.py migrate --noinput" % settings)
sh("DJANGO_SETTINGS_MODULE=%s python -W ignore manage.py loaddata sample_admin.json" % settings)
sh("DJANGO_SETTINGS_MODULE=%s python -W ignore manage.py loaddata geonode/base/fixtures/default_oauth_apps.json" %
settings)
sh("%s python -W ignore manage.py loaddata geonode/base/fixtures/initial_data.json" %
sh("DJANGO_SETTINGS_MODULE=%s python -W ignore manage.py loaddata geonode/base/fixtures/initial_data.json" %
settings)

call_task('start_geoserver')

bind = options.get('bind', '0.0.0.0:8000')
foreground = '' if options.get('foreground', False) else '&'
sh('%s python -W ignore manage.py runmessaging %s' % (settings, foreground))
sh('%s python -W ignore manage.py runserver %s %s' %
sh('DJANGO_SETTINGS_MODULE=%s python -W ignore manage.py runmessaging %s' %
(settings, foreground))
sh('DJANGO_SETTINGS_MODULE=%s python -W ignore manage.py runserver %s %s' %
(settings, bind, foreground))
sh('sleep 30')
settings = 'REUSE_DB=1 %s' % settings
settings = 'REUSE_DB=1 DJANGO_SETTINGS_MODULE=%s' % settings

live_server_option = '--liveserver=localhost:8000'
if _django_11:
live_server_option = ''

info("GeoNode is now available, running the tests now.")
info("Running the tests now...")
sh(('%s python -W ignore manage.py test %s'
' %s --noinput %s' % (settings, name, _keepdb, live_server_option)))

Expand All @@ -917,10 +914,9 @@ def test_integration(options):
success = True
finally:
# don't use call task here - it won't run since it already has
stop()
stop(options)
_reset()

call_task('stop_geoserver')
_reset()
if not success:
sys.exit(1)

Expand Down Expand Up @@ -966,7 +962,7 @@ def run_tests(options):

@task
@needs(['stop'])
def reset():
def reset(options):
"""
Reset a development environment (Database, GeoServer & Catalogue)
"""
Expand All @@ -985,7 +981,7 @@ def _reset():


@needs(['reset'])
def reset_hard():
def reset_hard(options):
"""
Reset a development environment (Database, GeoServer & Catalogue)
"""
Expand All @@ -997,7 +993,7 @@ def reset_hard():
('type=', 't', 'Import specific data type ("vector", "raster", "time")'),
('settings=', 's', 'Specify custom DJANGO_SETTINGS_MODULE')
])
def setup_data():
def setup_data(options):
"""
Import sample data (from gisdata package) into GeoNode
"""
Expand All @@ -1011,7 +1007,7 @@ def setup_data():
data_dir = os.path.join(gisdata.GOOD_DATA, ctype)

settings = options.get('settings', '')
if settings:
if settings and 'DJANGO_SETTINGS_MODULE' not in settings:
settings = 'DJANGO_SETTINGS_MODULE=%s' % settings

sh("%s python -W ignore manage.py importlayers %s -v2" % (settings, data_dir))
Expand Down Expand Up @@ -1090,7 +1086,7 @@ def deb(options):


@task
def publish():
def publish(options):
if 'GPG_KEY_GEONODE' in os.environ:
key = os.environ['GPG_KEY_GEONODE']
else:
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pyopenssl==19.0.0

# geopython dependencies
pyproj>=1.9.5,<2.2.1.0
OWSLib==0.17.1
OWSLib==0.18.0
pycsw==2.4.0
SQLAlchemy==1.3.3 # required by PyCSW
Shapely==1.6.4.post2
Expand Down

0 comments on commit 73e983c

Please sign in to comment.