Exemplo n.º 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()
Exemplo n.º 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()
Exemplo n.º 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())
Exemplo n.º 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())
Exemplo n.º 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())
Exemplo n.º 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()
Exemplo n.º 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()
Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 10
0
class RegexFindIterSchema(RegexSchema):

    condition_match = fields.Boolean()
    condition = custom_fields.NativeOrPretty()
Exemplo n.º 11
0
class RegexSchema(AssertionSchema):

    string = custom_fields.NativeOrPretty()
    pattern = custom_fields.NativeOrPretty()
    flags = fields.Integer()
    match_indexes = fields.List(fields.List(fields.Integer()))
Exemplo n.º 12
0
class MembershipSchema(AssertionSchema):

    member = custom_fields.NativeOrPretty()
    container = custom_fields.NativeOrPretty()
Exemplo n.º 13
0
class BooleanSchema(AssertionSchema):

    expr = custom_fields.NativeOrPretty()
Exemplo n.º 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)
Exemplo n.º 15
0
class FuncAssertionSchema(AssertionSchema):

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

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