From 430ac840d60f83ef716edd585933d9b7df4846b4 Mon Sep 17 00:00:00 2001 From: Vinzenz Feenstra Date: Tue, 10 Mar 2020 08:54:48 +0100 Subject: [PATCH] Fix ActorContext breakage due to get_api_models ActorContext is used in tests to make a functional test of an actor. When the apis field for Actors was introduced, this has been overlooked. This patch adds the missing changes for this part of the code. Signed-off-by: Vinzenz Feenstra --- leapp/snactor/fixture.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/leapp/snactor/fixture.py b/leapp/snactor/fixture.py index 71b4346fb..425179b18 100644 --- a/leapp/snactor/fixture.py +++ b/leapp/snactor/fixture.py @@ -11,6 +11,7 @@ from leapp.compat import raise_with_traceback from leapp.messaging.inprocess import InProcessMessaging from leapp.repository.scan import find_and_scan_repositories +from leapp.utils import get_api_models from leapp.utils.audit import Execution, get_connection from leapp.utils.repository import find_repository_basedir @@ -66,6 +67,8 @@ class ActorContext(object): actors. It provides a set of methods that allow specifying input messages for the actor, executing the actor and to retrieve messages sent by the actor. """ + apis = () + def __init__(self, actor=None): self._actor = actor self._messaging = InProcessMessaging() @@ -80,7 +83,7 @@ def set_actor(self, actor): """ type(self).name = actor.name + '_feeder' # Consumes is here what it actually produces because we want to consume produced messages in 'consume' - type(self).consumes = actor.produces + type(self).consumes = get_api_models(actor, 'produces') self._actor = actor def feed(self, *models):