Skip to content

Commit

Permalink
Added tests for dependencies aggregated using RequiresVarFilter
Browse files Browse the repository at this point in the history
  • Loading branch information
tcalmant committed May 22, 2016
1 parent 621aeec commit 848b8de
Show file tree
Hide file tree
Showing 2 changed files with 257 additions and 123 deletions.
30 changes: 30 additions & 0 deletions tests/ipopo/ipopo_bundle.py
Expand Up @@ -36,6 +36,7 @@
FACTORY_IMMEDIATE = "ipopo.tests.immediate"
FACTORY_REQUIRES_BEST = "ipopo.tests.best"
FACTORY_REQUIRES_VAR_FILTER = "ipopo.tests.var_filter"
FACTORY_REQUIRES_VAR_FILTER_AGGREGATE = "ipopo.tests.var_filter.multiple"
FACTORY_TEMPORAL = "ipopo.tests.temporal"
FACTORY_ERRONEOUS = "ipopo.tests.erroneous"
FACTORY_HIDDEN_PROPS = "ipopo.tests.properties.hidden"
Expand Down Expand Up @@ -357,6 +358,35 @@ def unbind(self, svc, svc_ref):
"""
self.states.append(IPopoEvent.UNBOUND)


@ComponentFactory(FACTORY_REQUIRES_VAR_FILTER_AGGREGATE)
@RequiresVarFilter('service', IEchoService, aggregate=True,
spec_filter="(&(s={static})(a={answer}))")
@Property('answer', 'answer', 42)
class RequiresVarFilterAggregateComponentFactory(TestComponentFactory):
"""
Component factory with a RequiresVarFilter requirement
"""
@Bind
def bind(self, svc, svc_ref):
"""
Bound
"""
self.states.append(IPopoEvent.BOUND)

def change(self, new_value):
"""
Changes the filter property
"""
self.answer = new_value

@Unbind
def unbind(self, svc, svc_ref):
"""
Unbound
"""
self.states.append(IPopoEvent.UNBOUND)

# ------------------------------------------------------------------------------


Expand Down

0 comments on commit 848b8de

Please sign in to comment.