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
This commit is contained in:
Alexandr Kostrikov 2015-11-12 15:42:33 +03:00
parent dc2d51e525
commit 1dadcd0e5e

View File

@ -33,6 +33,7 @@ class TestBasic(object):
""" """
def __init__(self): def __init__(self):
self.env = EnvironmentModel() self.env = EnvironmentModel()
self._current_log_step = 0
@property @property
def test_program(self): def test_program(self):
@ -62,6 +63,17 @@ class TestBasic(object):
:param str details: additional info for a step :param str details: additional info for a step
""" """
test_func_name = get_test_method_name() 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) test_func = getattr(self.__class__, test_func_name)
docstring = test_func.__doc__ docstring = test_func.__doc__
docstring = '\n'.join([s.strip() for s in docstring.split('\n')]) docstring = '\n'.join([s.strip() for s in docstring.split('\n')])