Feedback Makers¶
Implements the feedback makers, which define how the feedback is provided to the user in case no overrides are set.
- class ExpectFeedbackMaker¶
Factory class used to generate feedback based on user input data and the defaults provided when configuring an implementaion of the
Asserter.Configuration
Methods
Generates a primed function that takes a potential user feedback override, and the type of feedback to be produced.
-
defaults:
DefaultExpectFeedback¶
- get_feedback_maker(inp)¶
Generates a primed function that takes a potential user feedback override, and the type of feedback to be produced.
If the custom feedback is
None, thedefault[typ]is used instead. The generated piece of feedback is guaranteed to not beNone.- Parameters:
inp (
ExpectFeedbackMakerInput) – The input data for the feedback maker function.- Returns:
A function that produces a piece of feedback.
- Return type:
Callable[[str | NoFeedback | None, FeedbackType], str | NoFeedback]
-
defaults:
- class ExistFeedbackMaker¶
Factory class used to generate feedback based on user input data and the defaults provided when configuring an implementation of the
Asserter.Configuration
Methods
Generates a primed function that takes a potential user feedback override, and the type of feedback to be produced.
-
defaults:
DefaultExistFeedback¶
- get_feedback_maker(inp)¶
Generates a primed function that takes a potential user feedback override, and the type of feedback to be produced.
If the custom feedback is
None, thedefault[typ]is used instead. The generated piece of feedback is guaranteed to not beNone.- Parameters:
inp (
ExistFeedbackMakerInput) – The input data for the feedback maker function.- Returns:
A function that produces a piece of feedback.
- Return type:
Callable[[str | NoFeedback | None, FeedbackType], str | NoFeedback]
-
defaults:
- class DefaultExpectFeedback¶
Default feedback maker functions for
ExpectFeedbackMaker.Feedback Makers
-
positive:
Callable[[ExpectFeedbackMakerInput],Union[str,NoFeedback]]¶ Maker function for positive feedback.
-
negative:
Callable[[ExpectFeedbackMakerInput],Union[str,NoFeedback]]¶ Maker function for negative feedback.
-
positive:
- class DefaultExistFeedback¶
Default feedback maker functions for
ExistFeedbackMaker.Feedback Makers
-
positive:
Callable[[ExistFeedbackMakerInput],Union[str,NoFeedback]]¶ Maker function for positive feedback.
-
negative:
Callable[[ExistFeedbackMakerInput],Union[str,NoFeedback]]¶ Maker function for negative feedback.
-
positive:
- class ExpectFeedbackMakerInput¶
Provides the parameters for
ExpectFeedbackMakerinstances. Defines the contents of the feedback provided to the user.Fields
What is the feedback about.
The value that was received.
The representation of the expected value.
- class ExistFeedbackMakerInput¶
Provides the parameters for
ExistFeedbackMakerinstances. Defines the contents of the feedback provided to the user.Fields
- PrimedFeedbackMakerF¶
A function that has been primed with configuration data and can be used to produce feedback pieces from the user override.
alias of
Callable[[str|NoFeedback|None,FeedbackType],str|NoFeedback]
- ExpectFeedbackMakerF¶
A function that takes a
ExpectFeedbackMakerInputinstance and produces a valid piece of feedback.alias of
Callable[[ExpectFeedbackMakerInput],str|NoFeedback]
- ExistFeedbackMakerF¶
A function that takes a
ExistFeedbackMakerInputinstance and produces a valid piece of feedback.alias of
Callable[[ExistFeedbackMakerInput],str|NoFeedback]