From 1dadcd0e5e83d1ca2d6512f94ca9ce7cc2e33dd7 Mon Sep 17 00:00:00 2001 From: Alexandr Kostrikov Date: Thu, 12 Nov 2015 15:42:33 +0300 Subject: [PATCH] Add order check in fuel log_step. The ordering is meaningfull and can mislead in log investigation. Simple counter added. Change-Id: I3c2ace4bc0f6d0722a40a0a32086c83f96b7494d Closes-bug: #1515610 --- fuelweb_test/tests/base_test_case.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/fuelweb_test/tests/base_test_case.py b/fuelweb_test/tests/base_test_case.py index 14993cbf6..5e92dee7a 100644 --- a/fuelweb_test/tests/base_test_case.py +++ b/fuelweb_test/tests/base_test_case.py @@ -33,6 +33,7 @@ class TestBasic(object): """ def __init__(self): self.env = EnvironmentModel() + self._current_log_step = 0 @property def test_program(self): @@ -62,6 +63,17 @@ class TestBasic(object): :param str details: additional info for a step """ test_func_name = get_test_method_name() + + self._current_log_step += 1 + if self._current_log_step != step: + error_message = 'The step {} should be {} at {}' + error_message = error_message.format( + step, + self._current_log_step, + test_func_name + ) + logger.error(error_message) + test_func = getattr(self.__class__, test_func_name) docstring = test_func.__doc__ docstring = '\n'.join([s.strip() for s in docstring.split('\n')])