Example #1
0
def test_long_read_errors_buried(with_readme):
    """Errors when trying to read long_description file should be buried."""

    with mock.patch.object(config.io, "open", side_effect=OSError):
        conf = config.get_config(with_readme[0])
    assert not conf._long_read
    assert not conf._long_read_in_setup
Example #2
0
def test_long_read_errors_buried(with_readme):
    """Errors when trying to read long_description file should be buried."""

    with mock.patch.object(config.io, "open", side_effect=OSError):
        conf = config.get_config(with_readme[0])
    assert not conf._long_read
    assert not conf._long_read_in_setup
Example #3
0
def test_write_pkg_info_shim(source_release):
    """Confirm the metadata shim to write out our extra metadata params."""

    pkg_root, source_label, source_url = source_release
    conf = config.get_config(pkg_root)

    conf.metadata.write_pkg_info(pkg_root)
    pkg_info_file = os.path.join(pkg_root, "PKG-INFO")
    with io.open(pkg_info_file, "r", encoding="utf-8") as openinfo:
        pkg_info = openinfo.read()

    assert pkg_info.startswith("Metadata-Version: 1.0")
    assert "Source-label: {}".format(source_label) in pkg_info
    assert "Source-url: {}".format(source_url) in pkg_info
Example #4
0
def test_write_pkg_info_shim(source_release):
    """Confirm the metadata shim to write out our extra metadata params."""

    pkg_root, source_label, source_url = source_release
    conf = config.get_config(pkg_root)

    conf.metadata.write_pkg_info(pkg_root)
    pkg_info_file = os.path.join(pkg_root, "PKG-INFO")
    with io.open(pkg_info_file, "r", encoding="utf-8") as openinfo:
        pkg_info = openinfo.read()

    assert pkg_info.startswith("Metadata-Version: 1.0")
    assert "Source-label: {}".format(source_label) in pkg_info
    assert "Source-url: {}".format(source_url) in pkg_info