Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Use a test Connection implementation instead of mocking a real one

Open
#156 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
testing

Research direction

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.

Written by the indexing model from the issue text.

Description

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.
Dominant language
Python
Stars
9
Forks
5
Avg merge
1d 9h
Merged PRs (30d)
4

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from eclipse-ankaios/ank-sdk-python

All issues in eclipse-ankaios/ank-sdk-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.