Skip to content
Snippets Groups Projects
Commit 5007d0dc authored by Marek Vavruša's avatar Marek Vavruša
Browse files

tests/integration: fixed TIME_PASSES

parent 2e7f3e4d
No related branches found
No related tags found
No related merge requests found
......@@ -196,12 +196,15 @@ class Step:
each step has an order identifier, type and optionally data entry.
"""
require_data = ['TIME_PASSES']
def __init__(self, id, type, extra_args):
""" Initialize single scenario step. """
self.id = int(id)
self.type = type
self.args = extra_args
self.data = []
self.has_data = self.type not in Step.require_data
def add(self, entry):
""" Append a data entry to this step. """
......@@ -241,7 +244,7 @@ class Step:
def __time_passes(self, ctx):
""" Modify system time. """
ctx.scenario.time = int(self.args[0])
ctx.scenario.time = int(self.args[1])
ctx.set_time(ctx.scenario.time)
......
......@@ -52,12 +52,12 @@ def parse_step(op, args, file_in):
if len(args) > 2:
extra_args = args[2:]
out = scenario.Step(args[0], args[1], extra_args)
op, args = get_next(file_in)
# Optional data
if op == 'ENTRY_BEGIN':
out.add(parse_entry(op, args, file_in))
else:
raise Exception('expected "ENTRY_BEGIN"')
if out.has_data:
op, args = get_next(file_in)
if op == 'ENTRY_BEGIN':
out.add(parse_entry(op, args, file_in))
else:
raise Exception('expected "ENTRY_BEGIN"')
return out
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment