6 from testlib
import cmk_path
, cmc_path
, cme_path
14 "cmk_base/default_config",
22 # TODO: Update all agent plugins to use sys.stdout.write instead of print
33 def test_find_debug_code():
35 for base_path
in [ cmk_path(), cmc_path(), cme_path() ]:
36 for dir_path
in check_paths
:
37 path
= "%s/%s" % (base_path
, dir_path
)
38 if not os
.path
.exists(path
):
41 for dirpath
, dirnames
, filenames
in os
.walk(path
):
43 for filename
in filenames
:
44 file_path
= "%s/%s" % (dirpath
, filename
)
45 if [folder
in file_path
for folder
in exclude_folders
]:
48 for nr
, line
in enumerate(open(file_path
)):
49 if nr
== 0 and ("bash" in line
or "php" in line
):
50 break # skip non python files
53 assert not l
.startswith("print("), \
54 "Found \"print(...)\" call in %s:%d" % \
56 assert not l
.startswith("pprint.pprint("), \
57 "Found \"print(...)\" call in %s:%d" % \
59 assert not l
.startswith("pprint("), \
60 "Found \"print(...)\" call in %s:%d" % \
62 assert not l
.startswith("print "), \
63 "Found \"print ...\" call in %s:%d" % \