1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2024-10-06 10:51:13 +01:00

StateDetection: Moved check for missing phase definition earlier.

Now checks to see if a phase is correctly defined before image matching
so that it is only performed if required.
This commit is contained in:
Marc Bonnici 2017-01-20 09:29:49 +00:00
parent 54bffb45ab
commit b89d9bbc4b

View File

@ -136,9 +136,6 @@ def verify_state(screenshot_file, state_defs_path, workload_phase):
with open(statedefs_file) as fh:
state_definitions = yaml.load(fh)
# run a match on the screenshot
matched_state = match_state(screenshot_file, state_defs_path, state_definitions)
# find what the expected state is for the given workload phase
expected_state = None
for phase in state_definitions["workload_phases"]:
@ -148,4 +145,7 @@ def verify_state(screenshot_file, state_defs_path, workload_phase):
if expected_state is None:
raise StateDefinitionError("Phase not defined")
# run a match on the screenshot
matched_state = match_state(screenshot_file, state_defs_path, state_definitions)
return expected_state == matched_state