Fix iterable problems due to context currifier, and some examples with wrong import paths.
This commit is contained in:
@ -15,6 +15,7 @@ class MethodBasedConfigurable(Configurable):
|
||||
|
||||
def test_one_wrapper_only():
|
||||
with pytest.raises(ConfigurationError):
|
||||
|
||||
class TwoMethods(Configurable):
|
||||
h1 = Method()
|
||||
h2 = Method()
|
||||
@ -25,7 +26,7 @@ def test_define_with_decorator():
|
||||
|
||||
@MethodBasedConfigurable
|
||||
def Concrete(self, *args, **kwargs):
|
||||
calls.append((args, kwargs,))
|
||||
calls.append((args, kwargs, ))
|
||||
|
||||
t = Concrete('foo', bar='baz')
|
||||
assert len(calls) == 0
|
||||
@ -37,19 +38,20 @@ def test_define_with_argument():
|
||||
calls = []
|
||||
|
||||
def concrete_handler(*args, **kwargs):
|
||||
calls.append((args, kwargs,))
|
||||
calls.append((args, kwargs, ))
|
||||
|
||||
t = MethodBasedConfigurable('foo', bar='baz', handler=concrete_handler)
|
||||
assert len(calls) == 0
|
||||
t()
|
||||
assert len(calls) == 1
|
||||
|
||||
|
||||
def test_define_with_inheritance():
|
||||
calls = []
|
||||
|
||||
class Inheriting(MethodBasedConfigurable):
|
||||
def handler(self, *args, **kwargs):
|
||||
calls.append((args, kwargs,))
|
||||
calls.append((args, kwargs, ))
|
||||
|
||||
t = Inheriting('foo', bar='baz')
|
||||
assert len(calls) == 0
|
||||
@ -65,7 +67,7 @@ def test_inheritance_then_decorate():
|
||||
|
||||
@Inheriting
|
||||
def Concrete(self, *args, **kwargs):
|
||||
calls.append((args, kwargs,))
|
||||
calls.append((args, kwargs, ))
|
||||
|
||||
t = Concrete('foo', bar='baz')
|
||||
assert len(calls) == 0
|
||||
|
||||
@ -79,4 +79,3 @@ def test_simple_execution_context():
|
||||
assert not ctx.alive
|
||||
assert ctx.started
|
||||
assert ctx.stopped
|
||||
|
||||
|
||||
Reference in New Issue
Block a user