Пример #1
0
    def convert_fixture(self, shapes_, apply_operation_to_, _add_freeform_sp_,
                        _start_path_, shape_):
        origin_x, origin_y = 42, 24
        sp, path = element("p:sp"), element("a:path")
        drawing_ops = (
            _BaseDrawingOperation(None, None, None),
            _BaseDrawingOperation(None, None, None),
        )
        shapes_._shape_factory.return_value = shape_
        _add_freeform_sp_.return_value = sp
        _start_path_.return_value = path

        builder = FreeformBuilder(shapes_, None, None, None, None)
        builder._drawing_operations.extend(drawing_ops)
        calls = [call(drawing_ops[0], path), call(drawing_ops[1], path)]
        return (builder, origin_x, origin_y, sp, apply_operation_to_, calls,
                shape_)
Пример #2
0
    def convert_fixture(
        self, shapes_, apply_operation_to_, _add_freeform_sp_, _start_path_, shape_
    ):
        origin_x, origin_y = 42, 24
        sp, path = element("p:sp"), element("a:path")
        drawing_ops = (
            _BaseDrawingOperation(None, None, None),
            _BaseDrawingOperation(None, None, None),
        )
        shapes_._shape_factory.return_value = shape_
        _add_freeform_sp_.return_value = sp
        _start_path_.return_value = path

        builder = FreeformBuilder(shapes_, None, None, None, None)
        builder._drawing_operations.extend(drawing_ops)
        calls = [call(drawing_ops[0], path), call(drawing_ops[1], path)]
        return (builder, origin_x, origin_y, sp, apply_operation_to_, calls, shape_)
Пример #3
0
    def shape_offset_y_fixture(self, request):
        start_y, ys, expected_value = request.param
        drawing_ops = []
        for y in ys:
            if y is None:
                drawing_ops.append(_Close())
            else:
                drawing_ops.append(_BaseDrawingOperation(None, None, y))

        builder = FreeformBuilder(None, None, start_y, None, None)
        builder._drawing_operations.extend(drawing_ops)
        return builder, expected_value
Пример #4
0
    def dx_fixture(self, request):
        start_x, xs, expected_value = request.param
        drawing_ops = []
        for x in xs:
            if x is None:
                drawing_ops.append(_Close())
            else:
                drawing_ops.append(_BaseDrawingOperation(None, x, None))

        builder = FreeformBuilder(None, start_x, None, None, None)
        builder._drawing_operations.extend(drawing_ops)
        return builder, expected_value
Пример #5
0
    def shape_offset_y_fixture(self, request):
        start_y, ys, expected_value = request.param
        drawing_ops = []
        for y in ys:
            if y is None:
                drawing_ops.append(_Close())
            else:
                drawing_ops.append(_BaseDrawingOperation(None, None, y))

        builder = FreeformBuilder(None, None, start_y, None, None)
        builder._drawing_operations.extend(drawing_ops)
        return builder, expected_value
Пример #6
0
    def dx_fixture(self, request):
        start_x, xs, expected_value = request.param
        drawing_ops = []
        for x in xs:
            if x is None:
                drawing_ops.append(_Close())
            else:
                drawing_ops.append(_BaseDrawingOperation(None, x, None))

        builder = FreeformBuilder(None, start_x, None, None, None)
        builder._drawing_operations.extend(drawing_ops)
        return builder, expected_value
Пример #7
0
 def y_fixture(self):
     y = 24
     drawing_operation = _BaseDrawingOperation(None, None, y)
     expected_value = y
     return drawing_operation, expected_value
Пример #8
0
 def x_fixture(self):
     x = 42
     drawing_operation = _BaseDrawingOperation(None, x, None)
     expected_value = x
     return drawing_operation, expected_value
Пример #9
0
 def y_fixture(self):
     y = 24
     drawing_operation = _BaseDrawingOperation(None, None, y)
     expected_value = y
     return drawing_operation, expected_value
Пример #10
0
 def x_fixture(self):
     x = 42
     drawing_operation = _BaseDrawingOperation(None, x, None)
     expected_value = x
     return drawing_operation, expected_value