text_lint.linter.states.assertion.AssertionState
- class text_lint.linter.states.assertion.AssertionState(linter: Linter)[source]
Bases:
StateBaseState for assertion operations.
- __init__(linter: Linter) None[source]
Initialize AssertionState instances.
- Parameters:
linter (Linter) – The linter instance being encapsulated.
- fail(expected: str) None[source]
Raise an exception indicating this operation has failed.
- Parameters:
expected (str) – The value the assertion operation was expecting.
- loop(assertions: List[AssertionBase], count: int) None[source]
Start a looped sequence of assertions after the current operation.
- Parameters:
assertions (List[AssertionBase]) – A list of assertion operations to loop over.
count (int) – The number of times to repeat these operations.
- next() str[source]
Read the next line from the text file.
- Returns:
The next line from the text file.
- Return type:
str