diff --git a/Makefile b/Makefile index 53ede91..338cf59 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ virtualenv: netaddr jinja2 lint: virtualenv - .venv/bin/flake8 --exclude hooks/charmhelpers hooks unit_tests tests + .venv/bin/flake8 --exclude hooks/charmhelpers hooks unit_tests tests --ignore E402 @charm proof unit_test: virtualenv diff --git a/hooks/pg_dir_utils.py b/hooks/pg_dir_utils.py index dacf0c7..c437a6f 100644 --- a/hooks/pg_dir_utils.py +++ b/hooks/pg_dir_utils.py @@ -327,8 +327,7 @@ def post_pg_license(): 'plumgrid:plumgrid', LICENSE_POST_PATH, '-d', - json.dumps(license) - ] + json.dumps(license)] licence_get_cmd = [PG_CURL, '-u', 'plumgrid:plumgrid', LICENSE_GET_PATH] try: old_license = subprocess.check_output(licence_get_cmd) diff --git a/unit_tests/test_pg_dir_hooks.py b/unit_tests/test_pg_dir_hooks.py index de76231..dd0b850 100644 --- a/unit_tests/test_pg_dir_hooks.py +++ b/unit_tests/test_pg_dir_hooks.py @@ -1,5 +1,7 @@ from mock import MagicMock, patch, call + from test_utils import CharmTestCase + with patch('charmhelpers.core.hookenv.config') as config: config.return_value = 'neutron' import pg_dir_utils as utils @@ -9,6 +11,7 @@ _map = utils.restart_map utils.register_configs = MagicMock() utils.restart_map = MagicMock() + import pg_dir_hooks as hooks utils.register_configs = _reg