Only 50 test are really performed.
Some tests are not fully implemented, for example, arc_3points, dimension_radial,
shapestring, trim, extend, and stretch. The reason is that there are no proper
functions to test.
In order to have a unit test, basic functions that perform these actions
must be written inside Draft.py. At the moment, these tests just
run a _fake_function() which always returns successfully
and thus the test always passes without problem.
There are also tests for the import and export
of SVG, DXF, DWG, and OCA files. Currently these are also not implemented.
Sample files could be provided in the source tree in order to test basic operations
like opening, import, and export.
A complete unit test would require writing a test for each geometrical element
that could be imported and exported, that is, line, circle, arc, rectangle, etc.
These tests are inspired by the tests in the FEM workbench.
Import of modules is tested, as well as the creation and modification tools.
Eventually, the tests should be migrated to individual modules,
and test files should be provided to serve as reference.
On Windows, the python script opens a file with the default ANSI
encoding. This causes UnicodeDecodeError in some region. The encoding
should be set explicitly to match the files.
- for the reason of the change, see https://forum.freecadweb.org/viewtopic.php?f=35&t=40608
- also use "0.0" as initialization because these values are floats, not integers and e.g. in the mesh WB these are initialized that way
The code was trying to iterate over a `range(0, pntsPerLine)`, but
pntsPerLine was a float resulting from a division.
Convert pntsPerLine to an int, and only ignore waste if this was
successful.
In daily work there are 2 main methods to work with meshes: creating one from a shape or importing an existent one.
Since the generation from a shape is often needed, add its icon to the default toolbar.