示例#1
0
def test_get_functions():
    module_three = import_module_file(module_three_path)
    expected = [("function_three", module_three.function_three)]

    result = get_functions(module_three)

    assert expected == result
示例#2
0
def test_get_values():
    module_three = import_module_file(module_three_path)
    expected = ("value_one", module_three.value_one)

    result = get_values(module_three)

    assert expected in result
示例#3
0
def test_import_module_file_package():
    expected = "result_three"

    module_three = import_module_file(module_three_path)
    result = module_three.function_three()

    assert expected == result
示例#4
0
def test_get_classes():
    module_three = import_module_file(module_three_path)
    expected = [("ClassOne", module_three.ClassOne)]

    result = get_classes(module_three)

    assert expected == result
示例#5
0
def test_import_module_file_directory():
    expected = "result_one"

    module_one = import_module_file(module_one_path)
    result = module_one.function_one()

    assert expected == result
示例#6
0
def test_get_member():
    module_three = import_module_file(module_three_path)

    assert get_member(module_three, "function_three") is module_three.function_three
    assert get_member(module_three, "ClassOne") is module_three.ClassOne
    assert get_member(module_three, "value_one") is module_three.value_one
示例#7
0
def test_has_member():
    module_three = import_module_file(module_three_path)

    assert has_member(module_three, "function_three")
    assert has_member(module_three, "ClassOne")
    assert has_member(module_three, "value_one")
示例#8
0
def test_is_callable_after_import():
    assert is_callable(import_module_file(module_one_path).function_one)
    assert is_callable(import_module_file(module_three_path).function_three)
示例#9
0
def test_is_module():
    assert import_module_file(module_one_path)
    assert import_module_file(module_three_path)