test_exporter_exports_extra_index_url_and_trusted_host fails

Đang mở
#218 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
tooling

Hướng nghiên cứu

Bắt đầu bằng cách chạy tests/test_exporter.py::test_exporter_exports_extra_index_url_and_trusted_host và kiểm tra entry point của exporter được test sử dụng. Công việc được xem là hoàn tất khi requirements.txt được tạo ra bao gồm các dòng trusted-host và extra-index-url như trong đầu ra mong đợi, đồng thời giữ nguyên các yêu cầu về package hiện có.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― 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

Ngôn ngữ chính
Python
Star
336
Fork
60
Merge trung bình
10 phút
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của python-poetry/poetry-plugin-export

Tất cả issue của python-poetry/poetry-plugin-export

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.