Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_exporter_exports_extra_index_url_and_trusted_host fails #218

Open
yurivict opened this issue Jul 6, 2023 · 1 comment
Open

test_exporter_exports_extra_index_url_and_trusted_host fails #218

yurivict opened this issue Jul 6, 2023 · 1 comment

Comments

@yurivict
Copy link

yurivict commented Jul 6, 2023

――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― test_exporter_exports_extra_index_url_and_trusted_host ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

tmp_path = PosixPath('/tmp/pytest-of-yuri/pytest-1/test_exporter_exports_extra_in0'), poetry = <poetry.poetry.Poetry object at 0x954ed7c10>

    def test_exporter_exports_extra_index_url_and_trusted_host(
        tmp_path: Path, poetry: Poetry
    ) -> None:
        poetry.pool.add_repository(
            LegacyRepository(
                "custom",
                "http://example.com/simple",
            ),
            priority=Priority.EXPLICIT,
        )
        poetry.locker.mock_lock_data(  # type: ignore[attr-defined]
            {
                "package": [
                    {
                        "name": "foo",
                        "version": "1.2.3",
                        "optional": False,
                        "python-versions": "*",
                        "dependencies": {"bar": "*"},
                    },
                    {
                        "name": "bar",
                        "version": "4.5.6",
                        "optional": False,
                        "python-versions": "*",
                        "source": {
                            "type": "legacy",
                            "url": "http://example.com/simple",
                            "reference": "",
                        },
                    },
                ],
                "metadata": {
                    "python-versions": "*",
                    "content-hash": "123456789",
                    "files": {"foo": [], "bar": []},
                },
            }
        )
        set_package_requires(poetry)
    
        exporter = Exporter(poetry, NullIO())
        exporter.export("requirements.txt", tmp_path, "requirements.txt")
    
        with (tmp_path / "requirements.txt").open(encoding="utf-8") as f:
            content = f.read()
    
        expected = f"""\
    --trusted-host example.com
    --extra-index-url http://example.com/simple
    
    bar==4.5.6 ; {MARKER_PY}
    foo==1.2.3 ; {MARKER_PY}
    """
>       assert content == expected
E       assert '\nbar==4.5.6...ion < "4.0"\n' == '--trusted-ho...ion < "4.0"\n'
E         - --trusted-host example.com
E         - --extra-index-url http://example.com/simple
E           
E           bar==4.5.6 ; python_version >= "2.7" and python_version < "2.8" or python_version >= "3.6" and python_version < "4.0"
E           foo==1.2.3 ; python_version >= "2.7" and python_version < "2.8" or python_version >= "3.6" and python_version < "4.0"

tests/test_exporter.py:2722: AssertionError

Version: 1.4.0
Python-3.9
FreeBSD 13.2

@dimbleby
Copy link
Contributor

dimbleby commented Jul 6, 2023

as this project's pipelines show: no, it doesn't.

you'll have to figure out for yourself what you're doing differenty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants