Skip to content
Snippets Groups Projects
Commit 93083c24 authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[algorithm][Runner] Implement validate method

This will call the validation method of the loop algorithm.
parent 846772a2
No related branches found
No related tags found
2 merge requests!281.6.x,!27Soft loop
...@@ -271,6 +271,25 @@ class Runner(object): ...@@ -271,6 +271,25 @@ class Runner(object):
raise exc('Unknown algorithm type: %s' % self.algorithm.type) raise exc('Unknown algorithm type: %s' % self.algorithm.type)
def validate(self, result):
"""Validates the given results"""
exc = self.exc or RuntimeError
if self.algorithm.type != Algorithm.LOOP:
raise exc('Wrong algorithm type: %s' % self.algorithm.type)
# setup() must have run
if not self.ready:
raise exc("Algorithm '%s' is not yet setup" % self.name)
# prepare() must have run
if not self.prepared:
raise exc("Algorithm '%s' is not yet prepared" % self.name)
return loader.run(self.obj, 'validate', self.exc, result)
def __getattr__(self, key): def __getattr__(self, key):
"""Returns an attribute of the algorithm - only called at last resort """Returns an attribute of the algorithm - only called at last resort
""" """
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment