Skip to content

Commit

Permalink
Fix ActorContext breakage due to get_api_models
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
vinzenz authored and pirat89 committed Mar 10, 2020
1 parent 106512b commit 430ac84
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion leapp/snactor/fixture.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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()
Expand All @@ -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):
Expand Down

0 comments on commit 430ac84

Please sign in to comment.