Пример #1
0
def test_display_name_dir_converter(display_name_tree):
    def dir_name_to_display_name(dir_name: str):
        return dir_name.upper().replace("_", " ")

    assert (utils.display_name(
        display_name_tree, dir_display_name_converter=dir_name_to_display_name)
            == "DISPLAY NAME TEST")
Пример #2
0
def test_display_name_file_and_package(display_name_tree):
    display_name_file = display_name_tree / "display_name.txt"
    display_name_file.write_text("Fancy Display Name")
    assert utils.display_name(display_name_tree,
                              "a.b.c") == "Fancy Display Name"
Пример #3
0
def test_display_name_package(display_name_tree):
    assert utils.display_name(display_name_tree,
                              "a.b.package_name") == "Package Name"
Пример #4
0
def test_display_name_file(display_name_tree):
    display_name_file = display_name_tree / "display_name.txt"
    display_name_file.write_text("Fancy Display Name")
    assert utils.display_name(display_name_tree) == "Fancy Display Name"
Пример #5
0
def test_display_name_folder(display_name_tree):
    assert utils.display_name(display_name_tree) == "Display Name Test"