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

refactor: unit tests DATA variables to use AntaTestStatus #995

Open
mtache opened this issue Jan 7, 2025 · 0 comments
Open

refactor: unit tests DATA variables to use AntaTestStatus #995

mtache opened this issue Jan 7, 2025 · 0 comments

Comments

@mtache
Copy link
Collaborator

mtache commented Jan 7, 2025

Currently, we use string literals as expected test result in our unit tests:

class AtomicResult(TypedDict):
    """Expected atomic result of a unit test of an AntaTest subclass."""

    result: Literal["success", "failure", "skipped"]
class Expected(TypedDict):
    """Expected result of a unit test of an AntaTest subclass."""

    result: Literal["success", "failure", "skipped"]

Now that we have a AntaTestStatus we should use it instead:

class AtomicResult(TypedDict):
    """Expected atomic result of a unit test of an AntaTest subclass."""

    result: AntaTestStatus
class Expected(TypedDict):
    """Expected result of a unit test of an AntaTest subclass."""

    result: AntaTestStatus

NB: find a way to remove ERROR (an unexpected error has been caught by the ANTA framework, not by the test code) and UNSET (the test has never run) statuses that should not be expected in these test cases.

All the DATA variables must be refactored accordingly.

@mtache mtache changed the title refactor: refactor unit tests DATA variables to use AntaTestStatus refactor: unit tests DATA variables to use AntaTestStatus Jan 7, 2025
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

1 participant