def junk_method_name_test(): """ Check that an appropriate error is raised when attempting to call a method using junk. """ s = Service(service_addition) s.call(42)
def method_not_found_test(): """ Check that an appropriate error is raised when attempting to call an undefined method. """ s = Service(service_addition) s.call('subtract', 5, 2)
def create_simple_test(): """ Check that we can instantiate a service with a simplest possible module and call a service method. """ s = Service(service_addition) assert s.call('add', 1, 1) == 2
def simple_hierarchy_deeper_test(): """ Again checking we can call a simple nested method but this time a little deeper. """ s = Service(service_simple_hierarchy) value = 'silly walk' assert s.call('example.foo.bar.echo', value) == value
def simple_hierarchy_test(): """ Check that we can instantiate a service with the simplest possible module that implements hierarchy and call a nested method. """ s = Service(service_simple_hierarchy) value = 'silly walk' assert s.call('example.echo', value) == value
def access_hidden_methods_test(): s = Service(service_addition) s.call('__class__', 5, 2)