Skip to content

Commit

Permalink
doc(anta): Remove links from headers (#673)
Browse files Browse the repository at this point in the history
  • Loading branch information
titom73 authored May 14, 2024
1 parent c33a6e5 commit e4688e1
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 12 deletions.
12 changes: 9 additions & 3 deletions docs/advanced_usages/custom-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ class VerifyTemperature(AntaTest):

[AntaTest](../api/models.md#anta.models.AntaTest) also provide more advanced capabilities like [AntaCommand](../api/models.md#anta.models.AntaCommand) templating using the [AntaTemplate](../api/models.md#anta.models.AntaTemplate) class or test inputs definition and validation using [AntaTest.Input](../api/models.md#anta.models.AntaTest.Input) [pydantic](https://docs.pydantic.dev/latest/) model. This will be discussed in the sections below.

## [AntaTest](../api/models.md#anta.models.AntaTest) structure
## AntaTest structure

Full AntaTest API documentation is available in the [API documentation section](../api/models.md#anta.models.AntaTest)

### Class Attributes

Expand Down Expand Up @@ -98,7 +100,9 @@ class VerifyTemperature(AntaTest):

The base definition of [AntaTest.Input](../api/models.md#anta.models.AntaTest.Input) provides common test inputs for all [AntaTest](../api/models.md#anta.models.AntaTest) instances:

#### [Input](../api/models.md#anta.models.AntaTest.Input) model
#### Input model

Full `Input` model documentation is available in [API documentation section](../api/models.md#anta.models.AntaTest.Input)

::: anta.models.AntaTest.Input
options:
Expand All @@ -114,7 +118,9 @@ The base definition of [AntaTest.Input](../api/models.md#anta.models.AntaTest.In
show_root_toc_entry: false
heading_level: 10

#### [ResultOverwrite](../api/models.md#anta.models.AntaTest.Input.ResultOverwrite) model
#### ResultOverwrite model

Full `ResultOverwrite` model documentation is available in [API documentation section](../api/models.md#anta.models.AntaTest.Input.ResultOverwrite)

::: anta.models.AntaTest.Input.ResultOverwrite
options:
Expand Down
17 changes: 10 additions & 7 deletions docs/contribution.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,20 @@ All submodule should have its own pytest section under `tests/units/anta_tests/<

The Python modules in the `tests/units/anta_tests` folder define test parameters for AntaTest subclasses unit tests.
A generic test function is written for all unit tests in `tests.lib.anta` module.

The `pytest_generate_tests` function definition in `conftest.py` is called during test collection.

The `pytest_generate_tests` function will parametrize the generic test function based on the `DATA` data structure defined in `tests.units.anta_tests` modules.

See https://docs.pytest.org/en/7.3.x/how-to/parametrize.html#basic-pytest-generate-tests-example

The `DATA` structure is a list of dictionaries used to parametrize the test.
The list elements have the following keys:
- `name` (str): Test name as displayed by Pytest.
- `test` (AntaTest): An AntaTest subclass imported in the test module - e.g. VerifyUptime.
- `eos_data` (list[dict]): List of data mocking EOS returned data to be passed to the test.
- `inputs` (dict): Dictionary to instantiate the `test` inputs as defined in the class from `test`.
- `expected` (dict): Expected test result structure, a dictionary containing a key
The `DATA` structure is a list of dictionaries used to parametrize the test. The list elements have the following keys:

- `name` (str): Test name as displayed by Pytest.
- `test` (AntaTest): An AntaTest subclass imported in the test module - e.g. VerifyUptime.
- `eos_data` (list[dict]): List of data mocking EOS returned data to be passed to the test.
- `inputs` (dict): Dictionary to instantiate the `test` inputs as defined in the class from `test`.
- `expected` (dict): Expected test result structure, a dictionary containing a key
`result` containing one of the allowed status (`Literal['success', 'failure', 'unset', 'skipped', 'error']`) and optionally a key `messages` which is a list(str) and each message is expected to be a substring of one of the actual messages in the TestResult object.


Expand Down
4 changes: 2 additions & 2 deletions docs/stylesheets/extra.material.css
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
/* font-weight: 700; */
letter-spacing: -.01em;
color: var(--md-default-fg-color--light);
text-transform: uppercase;
text-transform: capitalize;
font-style: normal;
font-weight: bolder;
}
Expand All @@ -129,7 +129,7 @@
/* font-weight: 700; */
letter-spacing: -.01em;
color: var(--md-default-fg-color--light);
text-transform: uppercase;
text-transform: capitalize;
font-style: normal;
font-weight: bold;
}
Expand Down

0 comments on commit e4688e1

Please sign in to comment.