Page MenuHome

Mathutils Vector tests for Automated tests project
Needs RevisionPublic

Authored by Patrice Bertrand (PatB) on Mar 28 2014, 9:49 AM.

Details

Reviewers
None
Summary

Tests for Vector functions: cross, angle, angle_signed, rotation_difference, project, lerp, rotate, dot.

Diff Detail

Event Timeline

Looks good, noted some issues.

And I think it would be good to add some error cases too. (zero area vectors, float('nan') vectors even)

source/tests/bl_pyapi_mathutils.py
257

*picky* pep8, spaces around operators a = b

364

I'd like to avoid values like 5.600000381469727 - they could even fail to compare on different systems.

Suggest to use assertAlmostEqual() then pass in the distance between the 2 vectors.

source/tests/bl_pyapi_mathutils.py
364

Note, it may be worth to write a utility function to compare Vector's Quats, Eulers... etc with some threshold,

To saving doing it for every test.

Campbell Barton (campbellbarton) requested changes to this revision.Feb 2 2015, 2:56 PM
Campbell Barton (campbellbarton) edited edge metadata.
This revision now requires changes to proceed.Feb 2 2015, 2:56 PM