Beispiel #1
0
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()
Beispiel #2
0
class ApproximateEqualitySchema(AssertionSchema):

    first = custom_fields.NativeOrPretty()
    second = custom_fields.NativeOrPretty()
    rel_tol = custom_fields.NativeOrPretty()
    abs_tol = custom_fields.NativeOrPretty()
    label = fields.String()
Beispiel #3
0
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())
Beispiel #4
0
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())
Beispiel #5
0
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())
Beispiel #6
0
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()
Beispiel #7
0
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()
Beispiel #8
0
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
Beispiel #9
0
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
Beispiel #10
0
class RegexFindIterSchema(RegexSchema):

    condition_match = fields.Boolean()
    condition = custom_fields.NativeOrPretty()
Beispiel #11
0
class RegexSchema(AssertionSchema):

    string = custom_fields.NativeOrPretty()
    pattern = custom_fields.NativeOrPretty()
    flags = fields.Integer()
    match_indexes = fields.List(fields.List(fields.Integer()))
Beispiel #12
0
class MembershipSchema(AssertionSchema):

    member = custom_fields.NativeOrPretty()
    container = custom_fields.NativeOrPretty()
Beispiel #13
0
class BooleanSchema(AssertionSchema):

    expr = custom_fields.NativeOrPretty()
Beispiel #14
0
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)
Beispiel #15
0
class FuncAssertionSchema(AssertionSchema):

    first = custom_fields.NativeOrPretty()
    second = custom_fields.NativeOrPretty()
    label = fields.String()
Beispiel #16
0
def native_or_pretty():
    return fields.NativeOrPretty()
Beispiel #17
0
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())
Beispiel #18
0
class ProcessExitStatusSchema(AssertionSchema):

    process = custom_fields.NativeOrPretty()
    expected_retcode = fields.Integer()
    core_file = fields.String()