Example #1
0
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)
Example #2
0
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)
Example #3
0
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
Example #4
0
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
Example #5
0
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
Example #6
0
def access_hidden_methods_test():
    s = Service(service_addition)
    s.call('__class__', 5, 2)