class DictMatchSchema(AssertionSchema): include_keys = fields.List(custom_fields.NativeOrPretty()) exclude_keys = fields.List(custom_fields.NativeOrPretty()) actual_description = fields.String() expected_description = fields.String() comparison = fields.Raw()
class ApproximateEqualitySchema(AssertionSchema): first = custom_fields.NativeOrPretty() second = custom_fields.NativeOrPretty() rel_tol = custom_fields.NativeOrPretty() abs_tol = custom_fields.NativeOrPretty() label = fields.String()
class DictCheckSchema(AssertionSchema): has_keys = fields.List(custom_fields.NativeOrPretty()) has_keys_diff = fields.List(custom_fields.NativeOrPretty()) absent_keys = fields.List(custom_fields.NativeOrPretty()) absent_keys_diff = fields.List(custom_fields.NativeOrPretty())
class ColumnContainSchema(AssertionSchema): # table = fields.List(custom_fields.NativeOrPrettyDict()) values = fields.List(custom_fields.NativeOrPretty()) column = fields.String() limit = fields.Integer() report_fails_only = fields.Boolean() data = fields.List(custom_fields.ColumnContainComparisonField())
class LineDiffSchema(AssertionSchema): first = fields.List(custom_fields.NativeOrPretty()) second = fields.List(custom_fields.NativeOrPretty()) ignore_space_change = custom_fields.NativeOrPretty() ignore_whitespaces = custom_fields.NativeOrPretty() ignore_blank_lines = custom_fields.NativeOrPretty() unified = custom_fields.NativeOrPretty() context = custom_fields.NativeOrPretty() delta = fields.List(custom_fields.NativeOrPretty())
class XMLCheckSchema(AssertionSchema): xpath = fields.String() tags = fields.List(fields.String()) xml = custom_fields.XMLElementField(attribute="element") namespaces = fields.Dict(fields.String()) data = fields.List(fields.List(custom_fields.NativeOrPretty())) message = fields.String()
class ExceptionRaisedSchema(AssertionSchema): raised_exception = custom_fields.ExceptionField() expected_exceptions = fields.List(custom_fields.NativeOrPretty()) pattern = custom_fields.Unicode(allow_none=True) func = fields.String(allow_none=True) exception_match = fields.Boolean() func_match = fields.Boolean() pattern_match = fields.Boolean()
class ReportSchema(schemas.TreeNodeSchema): """Schema for ``base.Report``""" source_class = Report name = fields.String() description = fields.String(allow_none=True) entries = fields.List(custom_fields.NativeOrPretty()) uid = fields.String() logs = fields.Nested(ReportLogSchema, many=True) @post_load def make_report(self, data): """Create report object, attach log list.""" logs = data.pop('logs', []) rep = self.get_source_class()(**data) rep.logs = logs return rep
class ReportSchema(schemas.TreeNodeSchema): """Schema for ``base.Report``.""" class Meta: unknown = EXCLUDE source_class = Report name = fields.String() description = fields.String(allow_none=True) entries = fields.List(custom_fields.NativeOrPretty()) parent_uids = fields.List(fields.String()) uid = fields.String() logs = fields.Nested(ReportLogSchema, many=True) hash = fields.Integer(dump_only=True) @post_load def make_report(self, data, **kwargs): """Create report object, attach log list.""" logs = data.pop("logs", []) rep = self.get_source_class()(**data) rep.logs = logs return rep
class RegexFindIterSchema(RegexSchema): condition_match = fields.Boolean() condition = custom_fields.NativeOrPretty()
class RegexSchema(AssertionSchema): string = custom_fields.NativeOrPretty() pattern = custom_fields.NativeOrPretty() flags = fields.Integer() match_indexes = fields.List(fields.List(fields.Integer()))
class MembershipSchema(AssertionSchema): member = custom_fields.NativeOrPretty() container = custom_fields.NativeOrPretty()
class BooleanSchema(AssertionSchema): expr = custom_fields.NativeOrPretty()
class TableLogSchema(BaseSchema): table = fields.List(fields.List(custom_fields.NativeOrPretty())) indices = fields.List(fields.Integer(), allow_none=True) display_index = fields.Boolean() columns = fields.List(fields.String(), allow_none=False)
class FuncAssertionSchema(AssertionSchema): first = custom_fields.NativeOrPretty() second = custom_fields.NativeOrPretty() label = fields.String()
def native_or_pretty(): return fields.NativeOrPretty()
class EqualSlicesSchema(AssertionSchema): data = fields.List(custom_fields.SliceComparisonField()) included_indices = fields.List(fields.Integer()) actual = fields.List(custom_fields.NativeOrPretty()) expected = fields.List(custom_fields.NativeOrPretty())
class ProcessExitStatusSchema(AssertionSchema): process = custom_fields.NativeOrPretty() expected_retcode = fields.Integer() core_file = fields.String()