Пример #1
0
def test_get_entrypoints_no_entrypoints(tmp_path):
    wheel_zip = make_wheel("simple", "0.1.0").save_to_dir(tmp_path)
    distribution = get_wheel_distribution(wheel_zip, "simple")

    console, gui = wheel.get_entrypoints(distribution)
    assert console == {}
    assert gui == {}
Пример #2
0
def test_get_entrypoints_no_entrypoints():
    wheel_zip = make_wheel("simple", "0.1.0").as_zipfile()
    distribution = pkg_resources_distribution_for_wheel(
        wheel_zip, "simple", "<in memory>")

    console, gui = wheel.get_entrypoints(distribution)
    assert console == {}
    assert gui == {}
Пример #3
0
def test_get_entrypoints(tmpdir, console_scripts):
    entry_points = tmpdir.joinpath("entry_points.txt")
    with open(str(entry_points), "w") as fp:
        fp.write("""
            [console_scripts]
            {}
            [section]
            common:one = module:func
            common:two = module:other_func
        """.format(console_scripts))

    assert wheel.get_entrypoints(str(entry_points)) == (
        dict([console_scripts.split(' = ')]),
        {},
    )
Пример #4
0
def test_get_entrypoints(tmp_path: pathlib.Path, console_scripts: str) -> None:
    entry_points_text = """
        [console_scripts]
        {}
        [section]
        common:one = module:func
        common:two = module:other_func
    """.format(console_scripts)

    distribution = make_wheel(
        "simple",
        "0.1.0",
        extra_metadata_files={
            "entry_points.txt": entry_points_text,
        },
    ).as_distribution("simple")

    entry_point, entry_point_value = console_scripts.split(" = ")
    assert wheel.get_entrypoints(distribution) == ({
        entry_point:
        entry_point_value
    }, {})
Пример #5
0
def test_get_entrypoints(tmp_path, console_scripts):
    entry_points_text = """
        [console_scripts]
        {}
        [section]
        common:one = module:func
        common:two = module:other_func
    """.format(console_scripts)

    wheel_zip = make_wheel(
        "simple",
        "0.1.0",
        extra_metadata_files={
            "entry_points.txt": entry_points_text,
        },
    ).save_to_dir(tmp_path)
    distribution = get_wheel_distribution(wheel_zip, "simple")

    assert wheel.get_entrypoints(distribution) == (
        dict([console_scripts.split(' = ')]),
        {},
    )
Пример #6
0
def test_get_entrypoints(console_scripts):
    entry_points_text = u"""
        [console_scripts]
        {}
        [section]
        common:one = module:func
        common:two = module:other_func
    """.format(console_scripts)

    wheel_zip = make_wheel(
        "simple",
        "0.1.0",
        extra_metadata_files={
            "entry_points.txt": entry_points_text,
        },
    ).as_zipfile()
    distribution = pkg_resources_distribution_for_wheel(
        wheel_zip, "simple", "<in memory>")

    assert wheel.get_entrypoints(distribution) == (
        dict([console_scripts.split(' = ')]),
        {},
    )
Пример #7
0
def test_get_entrypoints_no_entrypoints(tmp_path: pathlib.Path) -> None:
    distribution = make_wheel("simple", "0.1.0").as_distribution("simple")

    console, gui = wheel.get_entrypoints(distribution)
    assert console == {}
    assert gui == {}