Beispiel #1
0
def test_class():
    node = Node.factory('cli2.test_node.ExampleClass')
    assert node.target == ExampleClass
    assert Node('', ExampleClass.example_method) in node.callables
Beispiel #2
0
def test_unknown():
    node = Node.factory('lollololololololollolool')
    assert not node.module
    assert not node.target
Beispiel #3
0
def test_function():
    node = Node.factory('cli2.test_node.example_function')
    assert node.target == example_function
    assert node.type == 'function'
    assert not node.callables
Beispiel #4
0
def test_dict():
    node = Node.factory('cli2.test_node.example_dict.a')
    assert node.target == example_dict['a']
Beispiel #5
0
def test_list():
    node = Node.factory('cli2.test_node.example_list.0')
    assert node.target == example_list[0]
Beispiel #6
0
def test_eq():
    assert Node.factory('cli2') == Node.factory('cli2')
Beispiel #7
0
def test_callable_object():
    node = Node.factory('cli2.test_node.example_object_callable')
    assert node.target == example_object_callable
Beispiel #8
0
def test_callable_class():
    node = Node.factory('cli2.test_node.ExampleClassCallable')
    assert node.target == ExampleClassCallable