mailr5705 - /1.3/test_suite/unit_tests/_generic_fns/test_selection.py


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

Header


Content

Posted by edward on April 14, 2008 - 18:35:
Author: bugman
Date: Mon Apr 14 18:35:44 2008
New Revision: 5705

URL: http://svn.gna.org/viewcvs/relax?rev=5705&view=rev
Log:
Converted test_boolean_or_selection() to test_Selection_boolean_or().

The Selection object is being fully probed.


Modified:
    1.3/test_suite/unit_tests/_generic_fns/test_selection.py

Modified: 1.3/test_suite/unit_tests/_generic_fns/test_selection.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/test_suite/unit_tests/_generic_fns/test_selection.py?rev=5705&r1=5704&r2=5705&view=diff
==============================================================================
--- 1.3/test_suite/unit_tests/_generic_fns/test_selection.py (original)
+++ 1.3/test_suite/unit_tests/_generic_fns/test_selection.py Mon Apr 14 
18:35:44 2008
@@ -110,6 +110,34 @@
         self.assertEqual(obj._intersect[1].spins, ['Ca'])
 
 
+    def test_Selection_boolean_or(self):
+        """Test the Selection object for boolean '|' mol-res-spin 
selections."""
+
+        # The Selection object.
+        obj = selection.Selection("#Ap4Aase:Glu | #RNA@C8")
+
+        # Test the highest level object.
+        self.assertNotEqual(obj._union, None)
+        self.assertEqual(obj._intersect, None)
+        self.assertEqual(obj.molecules, [])
+        self.assertEqual(obj.residues, [])
+        self.assertEqual(obj.spins, [])
+
+        # Test the 1st union.
+        self.assertEqual(obj._union[0]._union, None)
+        self.assertEqual(obj._union[0]._intersect, None)
+        self.assertEqual(obj._union[0].molecules, ['Ap4Aase'])
+        self.assertEqual(obj._union[0].residues, ['Glu'])
+        self.assertEqual(obj._union[0].spins, [])
+
+        # Test the 2nd union.
+        self.assertEqual(obj._union[1]._union, None)
+        self.assertEqual(obj._union[1]._intersect, None)
+        self.assertEqual(obj._union[1].molecules, ['RNA'])
+        self.assertEqual(obj._union[1].residues, [])
+        self.assertEqual(obj._union[1].spins, ['C8'])
+
+
     def test_Selection_complex_boolean(self):
         """Test the Selection object for complex boolean mol-res-spin 
selections."""
 
@@ -1361,12 +1389,6 @@
         self.assertRaises(RelaxError, selection.tokenise, '')
 
 
-    def test_boolean_or_selection(self):
-        """Test boolean or in mol-res-spin selections."""
-
-        self.assert_(list(selection.spin_loop("#Ap4Aase | #RNA@N5")) == 
list(selection.spin_loop()))
-
-
     def test_boolean_and_selection(self):
         """Test boolean and in mol-res-spin selections."""
 




Related Messages


Powered by MHonArc, Updated Mon Apr 14 19:00:28 2008