McRogueFace/tools/test_vector_docs.py

20 lines
500 B
Python

import mcrfpy
import sys
# Check Vector.magnitude docstring
mag_doc = mcrfpy.Vector.magnitude.__doc__
print("magnitude doc:", mag_doc)
assert "magnitude()" in mag_doc
assert "Calculate the length/magnitude" in mag_doc
assert "Returns:" in mag_doc
# Check Vector.dot docstring
dot_doc = mcrfpy.Vector.dot.__doc__
print("dot doc:", dot_doc)
assert "dot(other: Vector)" in dot_doc
assert "Args:" in dot_doc
assert "other:" in dot_doc
print("SUCCESS: All docstrings present and complete")
sys.exit(0)