Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Use a test Connection implementation instead of mocking a real one

Đang mở
#156 0 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ó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
testing

Hướng nghiên cứu

Start by reading the Connection abstract class and the Ankaios tests that currently patch ControlInterfaceConnection.connect or write_request; the issue does not name specific files. Review run_checks.py for how to run unit tests, coverage, and lints. Done means applicable tests use a TestConnection to simulate behavior, with checks passing.

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

Mô tả

enhancement good first issue

Description

With the new Command Interface implementation, there is now an abstract class called Connection which is needed by Ankaios to communicate to the cluster. For testing the Ankaios class, the current way is to mock the connection methods. For example:

    with patch(
        "ankaios_sdk.ControlInterfaceConnection.connect"
    ) as mock_ci_connect:
        ...
    # or
    with patch(
        "ankaios_sdk.ControlInterfaceConnection.write_request",
    ) as mock_write:
        ...

This makes the tests harder to understand and to properly test.

With the new Connection abstract class, a TestConnection class can be developed and used throughout the tests, with which the functionality can be properly simulated and tested.

Goals

Rewrite the Ankaios tests and any other where it applies with a TestConnection class, as described above.

Final result

Summary

To be filled when the final solution is sketched.

Tasks
  • Assign yourself as assignee;
  • Implement enhancement;
  • Check and fix utests, coverage and lints;
  • Create Pull Request and fix possible workflow failures;
  • Add the ready_for_review label.
Ngôn ngữ chính
Python
Star
9
Fork
5
Merge trung bình
2 ngày 12 giờ
Pull request đã merge (30 ngày)
6

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

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 eclipse-ankaios/ank-sdk-python

Tất cả issue của eclipse-ankaios/ank-sdk-python

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.