Module: check_mk
Branch: master
Commit: 634b07c8299a052854b716c322d0c1c6e335c8d1
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=634b07c8299a05…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Mar 9 10:07:26 2017 +0100
pylint web: Loading CME specific files now
Change-Id: Iaf89b2c7327601e2445f64513bec1006168ddb25
---
tests/pylint/test_pylint_web.py | 11 +++++++----
tests/testlib/__init__.py | 9 +++++++++
2 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/tests/pylint/test_pylint_web.py b/tests/pylint/test_pylint_web.py
index 99cc5e9..fc3427f 100755
--- a/tests/pylint/test_pylint_web.py
+++ b/tests/pylint/test_pylint_web.py
@@ -7,7 +7,7 @@ import glob
import tempfile
import pytest
-from testlib import cmk_path, cmc_path
+from testlib import cmk_path, cmc_path, cme_path
import testlib.pylint_cmk as pylint_cmk
# Mark all tests in this file to be pylint checks
@@ -15,7 +15,8 @@ pytestmark = pytest.mark.pylint
def get_web_plugin_dirs():
plugin_dirs = sorted(list(set(os.listdir(cmk_path() + "/web/plugins")
- + os.listdir(cmc_path() + "/web/plugins"))))
+ + os.listdir(cmc_path() + "/web/plugins")
+ + os.listdir(cme_path() + "/web/plugins"))))
# icons are included from a plugin of views module. Move to the end to
# make them be imported after the views plugins. Same for perfometers.
@@ -30,7 +31,8 @@ def get_plugin_files(plugin_dir):
files = []
for path in [ cmk_path() + "/web/plugins/" + plugin_dir,
- cmc_path() + "/web/plugins/" + plugin_dir ]:
+ cmc_path() + "/web/plugins/" + plugin_dir,
+ cme_path() + "/web/plugins/" + plugin_dir ]:
if os.path.exists(path):
files += [ (f, path) for f in os.listdir(path) ]
@@ -44,7 +46,8 @@ def test_pylint_web():
sys.path.insert(0, base_path)
modules = glob.glob(cmk_path() + "/web/htdocs/*.py") \
- + glob.glob(cmc_path() + "/web/htdocs/*.py")
+ + glob.glob(cmc_path() + "/web/htdocs/*.py") \
+ + glob.glob(cme_path() + "/web/htdocs/*.py")
for module in modules:
print("Copy %s to test directory" % module)
diff --git a/tests/testlib/__init__.py b/tests/testlib/__init__.py
index d587049..5389e43 100644
--- a/tests/testlib/__init__.py
+++ b/tests/testlib/__init__.py
@@ -37,6 +37,10 @@ def cmc_path():
return repo_path() + "/enterprise"
+def cme_path():
+ return repo_path() + "/managed"
+
+
# Directory for persisting variable data produced by tests
def var_dir():
if "WORKSPACE" in os.environ:
@@ -320,6 +324,11 @@ class Site(object):
cmc_path() + "/agents",
]
+ if os.path.exists(cme_path()):
+ paths += [
+ cme_path() + "/web",
+ ]
+
for path in paths:
if os.path.exists("%s/.f12" % path):
print("Executing .f12 in \"%s\"..." % path)