CAF tests: crisp-edges property

Crisp edges property determines the rendering settings of the SVG drawing. Note: By now (and probably also by the future) the ‘shape-rendering’ property is run-time property only and is not stored or loaded from SVG files.

Tests

>>> import bar

Create empty slide and check its ‘crispEdges’ property

>>> testSlide = bar.barCafSlide()
>>> print testSlide.crispEdges
True

Let’s set crispEdges to False

>>> testSlide.crispEdges = False

Now, lets validate ‘crispEdges’ property on the path object. Path element has assigned corresponding attribute defined

>>> testPath = bar.barPath("structure_test_test", "M 100 100 L 100 200 L 200 200 Z", "#ff0000")
>>> testPath.crispEdges = True
>>> print testPath
<path bar:growlevel="0" d="M 100 100 L 100 200 L 200 200 Z" fill="#ff0000" id="structure_test_test" shape-rendering="crisp-edges" stroke="none"/>

>>> testPath.crispEdges = False
>>> print testPath
<path bar:growlevel="0" d="M 100 100 L 100 200 L 200 200 Z" fill="#ff0000" id="structure_test_test" shape-rendering="geometric-precision" stroke="none"/>

Note that crispEdges property accepts only boolean values. Providing type other than boolean will cause exception.

>>> testPath.crispEdges = 'string is invalid'
Traceback (most recent call last):
AssertionError: Boolean value expected

>>> testSlide.crispEdges = 'string is invalid'
Traceback (most recent call last):
AssertionError: Boolean value expected

crispEdgest should also always return boolean value:

>>> type(testPath.crispEdges) == type(True)
True

>>> type(testSlide.crispEdges) == type(True)
True

Table Of Contents

Previous topic

Basics of CAF datasets

Next topic

CAF tests: type property (barGenericStructure, barPath)

This Page