Skip to content
Snippets Groups Projects
Commit 17c654f5 authored by jack-parsons's avatar jack-parsons
Browse files

Updating docs

parent ad777bbc
Branches
No related tags found
1 merge request!23Merge in Jack's changes
Pipeline #856 passed
......@@ -14,9 +14,7 @@ class TestBasicFunction(unittest.TestCase):
sys.path.insert(0, modPath)
def test_python_imports(self):
"""
Test imports
"""
"""Test imports"""
import numpy, scipy, matplotlib, vtk, AmpScan.core
s = str(type(numpy))
self.assertEqual(s, "<class 'module'>")
......@@ -31,8 +29,6 @@ class TestBasicFunction(unittest.TestCase):
@unittest.expectedFailure
def test_failure(self):
"""
Test expected failure functionality of test suite
"""
"""Test expected failure functionality of test suite"""
s = str(type("string"))
self.assertEqual(s, "<class 'module'>")
"""
Testing suite for the core functionality
Testing suite for the core module
"""
import unittest
......@@ -21,9 +21,7 @@ class TestCore(unittest.TestCase):
self.amp = AmpObject(stl_path)
def test_centre(self):
"""
Test the centre method of AmpObject
"""
"""Test the centre method of AmpObject"""
# Translate the mesh
self.amp.translate([1, 0, 0])
......@@ -35,9 +33,7 @@ class TestCore(unittest.TestCase):
self.assertTrue(all(centre[i] < (10**-TestCore.ACCURACY) for i in range(3)))
def test_rotate_ang(self):
"""
Tests the rotateAng method of AmpObject
"""
"""Tests the rotateAng method of AmpObject"""
# Test rotation on random node
n = randrange(len(self.amp.vert))
......@@ -59,9 +55,7 @@ class TestCore(unittest.TestCase):
self.amp.rotateAng(dict())
def test_rotate(self):
"""
Tests the rotate method of AmpObject
"""
"""Tests the rotate method of AmpObject"""
# A test rotation and translation using list
m = [[1, 0, 0], [0, np.sqrt(3)/2, 1/2], [0, -1/2, np.sqrt(3)/2]]
self.amp.rotate(m)
......@@ -83,9 +77,7 @@ class TestCore(unittest.TestCase):
self.amp.rotate([[], [], []])
def test_translate(self):
"""
Test translating method of AmpObject
"""
"""Test translating method of AmpObject"""
# Check that everything has been translated correctly to a certain accuracy
start = self.amp.vert.mean(axis=0).copy()
......@@ -108,9 +100,7 @@ class TestCore(unittest.TestCase):
self.amp.translate([0, 0, 0, 0])
def test_rigid_transform(self):
"""
Test the rigid transform method of AmpObject
"""
"""Test the rigid transform method of AmpObject"""
# Test if no transform is applied, vertices aren't affected
before_vert = self.amp.vert.copy()
......
......@@ -8,8 +8,7 @@ import os
class TestTrim(unittest.TestCase):
def setUp(self):
"""
Runs before each unit test
"""Runs before each unit test
Sets up the AmpObject object using "sample_stl_sphere_BIN.stl"
"""
from AmpScan.core import AmpObject
......@@ -17,16 +16,13 @@ class TestTrim(unittest.TestCase):
self.amp = AmpObject(stl_path)
def test_trim(self):
"""
a new test for the trim module
"""
"""Tests the trim method of AmpObject"""
with self.assertRaises(TypeError):
self.amp.planarTrim([], plane=[])
@staticmethod
def get_path(filename):
"""
Returns the absolute path to the testing files
"""Returns the absolute path to the testing files
:param filename: Name of the file in tests folder
:return: The absolute path to the file
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment