Exemple #1
0
def test_class():
    node = Node.factory('cli2.test_node.ExampleClass')
    assert node.target == ExampleClass
    assert Node('', ExampleClass.example_method) in node.callables
Exemple #2
0
def test_unknown():
    node = Node.factory('lollololololololollolool')
    assert not node.module
    assert not node.target
Exemple #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
Exemple #4
0
def test_dict():
    node = Node.factory('cli2.test_node.example_dict.a')
    assert node.target == example_dict['a']
Exemple #5
0
def test_list():
    node = Node.factory('cli2.test_node.example_list.0')
    assert node.target == example_list[0]
Exemple #6
0
def test_eq():
    assert Node.factory('cli2') == Node.factory('cli2')
Exemple #7
0
def test_callable_object():
    node = Node.factory('cli2.test_node.example_object_callable')
    assert node.target == example_object_callable
Exemple #8
0
def test_callable_class():
    node = Node.factory('cli2.test_node.ExampleClassCallable')
    assert node.target == ExampleClassCallable