Example #1
0
 def test_default_param_assigned(processor_type):
     """Passing a Param value should have lower priority than the explicitly set Param value"""
     processor = processor_type(param_1='giraffe', is_output=False)
     ensured = ensure_processor(processor, is_output=True)
     assert not ensured.is_output
Example #2
0
 def test_default_param_omitted(processor_type):
     """Passing a Param value should set its default"""
     processor = processor_type(param_1='giraffe')
     ensured = ensure_processor(processor, is_output=True)
     assert ensured.is_output
Example #3
0
 def test_function(unbound_function):
     """Passing a function should create a FunctionProcessor"""
     ensured = ensure_processor(unbound_function)
     assert isinstance(ensured, FunctionProcessor)
Example #4
0
 def test_invalid():
     """Passing anythin but a callable or Processor should raise a TypeError"""
     with pytest.raises(TypeError):
         ensure_processor('mummy')
Example #5
0
 def test_processor(processor_type):
     """Passing an existing Processor should not create a new one."""
     processor = processor_type(param_1='giraffe')
     ensured = ensure_processor(processor)
     assert processor is ensured