Adding tests to the new methods.

This commit is contained in:
2022-01-17 12:26:36 -03:00
parent 9f21421d72
commit d83ff98365
2 changed files with 27 additions and 2 deletions
+18
View File
@@ -1,6 +1,8 @@
from behave import *
from cli import Replay
from datetime import datetime
# ============================= ENVIRONMENT VARIABLES GETTERS =============================
@given(u'the Replay client')
def step_impl (context):
@@ -14,3 +16,19 @@ def step_impl(context):
def step_impl(context):
for ret in context.returns.keys():
assert ( type(ret) == type(None) or type(ret) == type("") ), f'Something went wrong with the {context.returns[ret]} variable getter.'
# ============================= LOG REGISTERS =============================
@given(u'a Log created')
def step_impl(context):
context.log = context.client.new_log()
@when(u'the log method is called')
def step_impl(context):
context.dt_log_end = datetime.now().isoformat() + "Z"
context.log_return = context.client.log(context.log)
@then(u'this new log must be registered in the Replay Data Base')
def step_impl(context):
assert (context.client.sql("select * from logs")["data"][-1]["dtlogend"] == context.dt_log_end and context.log_return == "ok")