Module: check_mk
Branch: master
Commit: 077f6127d8e154c3c362f2f0a5250c8cc817f59d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=077f6127d8e154…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Tue Jan 30 12:39:35 2018 +0100
Testing time.clock in structured_data tests
Change-Id: I0c18dddf512987bf6e1f325a7b24e211a48fc695
---
tests/cmk/structured_data/test_structured_data.py | 43 +++++++++++++++--------
1 file changed, 28 insertions(+), 15 deletions(-)
diff --git a/tests/cmk/structured_data/test_structured_data.py
b/tests/cmk/structured_data/test_structured_data.py
index 5e34dfe..f5208f0 100644
--- a/tests/cmk/structured_data/test_structured_data.py
+++ b/tests/cmk/structured_data/test_structured_data.py
@@ -1,3 +1,4 @@
+import time
import pprint
import pytest
from testlib import repo_path, cmk_path, cmc_path, cme_path, CMKWebSession
@@ -557,28 +558,40 @@ def
test_structured_data_StructuredDataTree_cpu_tracking_load_from(trees, stats,
# ---loading tree---------------------------------------------------------
- cpu_tracking.start("busy")
+ #TODO testing
+ start = time.clock()
tree_old = StructuredDataTree().load_from("%s/%s" % (TEST_DIR,
tree_old_name))
- cpu_tracking.end()
- phase_times = cpu_tracking.get_times()
- total_times = phase_times["TOTAL"]
- run_time = total_times[4]
+ run_time = time.clock() - start
+ #cpu_tracking.start("busy")
+ #tree_old = StructuredDataTree().load_from("%s/%s" % (TEST_DIR,
tree_old_name))
+ #cpu_tracking.end()
+ #phase_times = cpu_tracking.get_times()
+ #total_times = phase_times["TOTAL"]
+ #run_time = total_times[4]
assert run_time < time_loading_tree
- cpu_tracking.start("busy")
+ #TODO testing
+ start = time.clock()
tree_new_fixed = StructuredDataTree().load_from("%s/%s" % (TEST_DIR,
tree_new_fixed_name))
- cpu_tracking.end()
- phase_times = cpu_tracking.get_times()
- total_times = phase_times["TOTAL"]
- run_time = total_times[4]
+ run_time = time.clock() - start
+ #cpu_tracking.start("busy")
+ #tree_new_fixed = StructuredDataTree().load_from("%s/%s" % (TEST_DIR,
tree_new_fixed_name))
+ #cpu_tracking.end()
+ #phase_times = cpu_tracking.get_times()
+ #total_times = phase_times["TOTAL"]
+ #run_time = total_times[4]
assert run_time < time_loading_tree
- cpu_tracking.start("busy")
+ #TODO testing
+ start = time.clock()
tree_new_variable = StructuredDataTree().load_from("%s/%s" % (TEST_DIR,
tree_new_variable_name))
- cpu_tracking.end()
- phase_times = cpu_tracking.get_times()
- total_times = phase_times["TOTAL"]
- run_time = total_times[4]
+ run_time = time.clock() - start
+ #cpu_tracking.start("busy")
+ #tree_new_variable = StructuredDataTree().load_from("%s/%s" % (TEST_DIR,
tree_new_variable_name))
+ #cpu_tracking.end()
+ #phase_times = cpu_tracking.get_times()
+ #total_times = phase_times["TOTAL"]
+ #run_time = total_times[4]
assert run_time < time_loading_tree
# ---count entries--------------------------------------------------------