mailr18668 - /trunk/test_suite/unit_tests/_lib/_geometry/test_lines.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on March 07, 2013 - 16:27:
Author: bugman
Date: Thu Mar  7 16:27:05 2013
New Revision: 18668

URL: http://svn.gna.org/viewcvs/relax?rev=18668&view=rev
Log:
Created a unit test for the lib.geometry.lines.closest_point() function.


Added:
    trunk/test_suite/unit_tests/_lib/_geometry/test_lines.py

Added: trunk/test_suite/unit_tests/_lib/_geometry/test_lines.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/test_suite/unit_tests/_lib/_geometry/test_lines.py?rev=18668&view=auto
==============================================================================
--- trunk/test_suite/unit_tests/_lib/_geometry/test_lines.py (added)
+++ trunk/test_suite/unit_tests/_lib/_geometry/test_lines.py Thu Mar  7 
16:27:05 2013
@@ -1,0 +1,39 @@
+###############################################################################
+#                                                                            
 #
+# Copyright (C) 2013 Edward d'Auvergne                                       
 #
+#                                                                            
 #
+# This file is part of the program relax (http://www.nmr-relax.com).         
 #
+#                                                                            
 #
+# This program is free software: you can redistribute it and/or modify       
 #
+# it under the terms of the GNU General Public License as published by       
 #
+# the Free Software Foundation, either version 3 of the License, or          
 #
+# (at your option) any later version.                                        
 #
+#                                                                            
 #
+# This program is distributed in the hope that it will be useful,            
 #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of             
 #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              
 #
+# GNU General Public License for more details.                               
 #
+#                                                                            
 #
+# You should have received a copy of the GNU General Public License          
 #
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.      
 #
+#                                                                            
 #
+###############################################################################
+
+# Python module imports.
+from numpy import array, float64, zeros
+from unittest import TestCase
+
+# relax module imports.
+from lib.geometry.lines import *
+
+class Test_lines(TestCase):
+    """Unit tests for the lib.geometry.lines relax module."""
+
+    def test_closest_point(self):
+        """Test the closest_point() function."""
+
+        # Get and check the point.
+        pt = closest_point(line_pt1=array([1, 1, 0], float64), 
line_pt2=array([-1, -1, 0], float64), point=array([0, 0, 10]))
+        self.assertEqual(pt[0], 0.0)
+        self.assertEqual(pt[1], 0.0)
+        self.assertEqual(pt[2], 0.0)




Related Messages


Powered by MHonArc, Updated Thu Mar 07 16:40:02 2013