mailr7692 - in /1.3/test_suite/system_tests: __init__.py xeasy.py


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

Header


Content

Posted by sebastien . morin . 1 on October 13, 2008 - 20:47:
Author: semor
Date: Mon Oct 13 20:47:19 2008
New Revision: 7692

URL: http://svn.gna.org/viewcvs/relax?rev=7692&view=rev
Log:
Added the framework for a XEasy system test.


Added:
    1.3/test_suite/system_tests/xeasy.py
Modified:
    1.3/test_suite/system_tests/__init__.py

Modified: 1.3/test_suite/system_tests/__init__.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/test_suite/system_tests/__init__.py?rev=7692&r1=7691&r2=7692&view=diff
==============================================================================
--- 1.3/test_suite/system_tests/__init__.py (original)
+++ 1.3/test_suite/system_tests/__init__.py Mon Oct 13 20:47:19 2008
@@ -53,6 +53,7 @@
 from state import State
 from structure import Structure
 from unit_vectors import Unit_vectors
+from xeasy import XEasy
 
 
 __all__ = ['angles',
@@ -76,7 +77,8 @@
            'state',
            'sparky',
            'structure',
-           'unit_vectors']
+           'unit_vectors',
+           'xeasy']
 
 
 class System_test_runner:
@@ -119,6 +121,7 @@
         suite_array.append(TestLoader().loadTestsFromTestCase(State))
         suite_array.append(TestLoader().loadTestsFromTestCase(Structure))
         suite_array.append(TestLoader().loadTestsFromTestCase(Unit_vectors))
+        suite_array.append(TestLoader().loadTestsFromTestCase(XEasy))
 
         # Add the relax namespace to each TestCase object.
         for i in xrange(len(suite_array)):

Added: 1.3/test_suite/system_tests/xeasy.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/test_suite/system_tests/xeasy.py?rev=7692&view=auto
==============================================================================
--- 1.3/test_suite/system_tests/xeasy.py (added)
+++ 1.3/test_suite/system_tests/xeasy.py Mon Oct 13 20:47:19 2008
@@ -1,0 +1,64 @@
+###############################################################################
+#                                                                            
 #
+# Copyright (C) 2008 Edward d'Auvergne                                       
 #
+#                                                                            
 #
+# This file is part of the program relax.                                    
 #
+#                                                                            
 #
+# relax 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 2 of the License, or          
 #
+# (at your option) any later version.                                        
 #
+#                                                                            
 #
+# relax 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 relax; if not, write to the Free Software                       
 #
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  
 #
+#                                                                            
 #
+###############################################################################
+
+# Python module imports.
+import sys
+from unittest import TestCase
+
+# relax module imports.
+from data import Relax_data_store; ds = Relax_data_store()
+from generic_fns import pipes
+
+
+class XEasy(TestCase):
+    """TestCase class for the functional tests for the support of XEasy in 
relax."""
+
+    def setUp(self):
+        """Set up for all the functional tests."""
+
+        # Create a data pipe.
+        self.relax.interpreter._Pipe.create('mf', 'mf')
+
+
+    def tearDown(self):
+        """Reset the relax data storage object."""
+
+        ds.__reset__()
+
+
+    def test_read_peak_list(self):
+        """Test the reading of an XEasy peak list."""
+
+        # Get the current data pipe.
+        cdp = pipes.get_pipe()
+
+        # Create the sequence data, and name the spins.
+        self.relax.interpreter._Residue.create(70)
+        self.relax.interpreter._Residue.create(72)
+        self.relax.interpreter._Spin.name(name='N')
+
+        # Read the peak list.
+        self.relax.interpreter._Relax_fit.read(file="cNTnC.xpk", 
dir=sys.path[-1] + "/test_suite/shared_data/peak_lists", relax_time=0.0176, 
format='xeasy')
+
+        # Test the data.
+        self.assertEqual(cdp.mol[0].res[0].spin[0].intensities[0][0], 
-6.88333129883)
+        self.assertEqual(cdp.mol[0].res[1].spin[0].intensities[0][0], 
-5.49038267136)




Related Messages


Powered by MHonArc, Updated Tue Oct 14 12:40:02 2008