mailr5702 - /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:20:
Author: bugman
Date: Mon Apr 14 18:03:12 2008
New Revision: 5702

URL: http://svn.gna.org/viewcvs/relax?rev=5702&view=rev
Log:
Expanded and completed the test_Selection_complex_boolean() unit test of 
"#Ap4Aase:4 & :Pro | #RNA".


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=5702&r1=5701&r2=5702&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:03:12 2008
@@ -116,9 +116,40 @@
         # The Selection object.
         obj = selection.Selection("#Ap4Aase:4 & :Pro | #RNA")
 
-        # Tests.
-        self.assertEqual(obj._intersect, None)
-        self.assertNotEqual(obj._union, None)
+        # Test the highest level object.
+        self.assertEqual(obj._union, None)
+        self.assertNotEqual(obj._intersect, None)
+        self.assertEqual(obj.molecules, [])
+        self.assertEqual(obj.residues, [])
+        self.assertEqual(obj.spins, [])
+
+        # Test the 1st intersection.
+        self.assertEqual(obj._intersect[0]._union, None)
+        self.assertEqual(obj._intersect[0]._intersect, None)
+        self.assertEqual(obj._intersect[0].molecules, ['Ap4Aase'])
+        self.assertEqual(obj._intersect[0].residues, [4])
+        self.assertEqual(obj._intersect[0].spins, [])
+
+        # Test the 2nd intersection (which should be a union).
+        self.assertNotEqual(obj._intersect[1]._union, None)
+        self.assertEqual(obj._intersect[1]._intersect, None)
+        self.assertEqual(obj._intersect[1].molecules, [])
+        self.assertEqual(obj._intersect[1].residues, [])
+        self.assertEqual(obj._intersect[1].spins, [])
+
+        # Test the 2nd intersection, 1st union.
+        self.assertEqual(obj._intersect[1]._union[0]._union, None)
+        self.assertEqual(obj._intersect[1]._union[0]._intersect, None)
+        self.assertEqual(obj._intersect[1]._union[0].molecules, [])
+        self.assertEqual(obj._intersect[1]._union[0].residues, ['Pro'])
+        self.assertEqual(obj._intersect[1]._union[0].spins, [])
+
+        # Test the 2nd intersection, 2nd union.
+        self.assertEqual(obj._intersect[1]._union[1]._union, None)
+        self.assertEqual(obj._intersect[1]._union[1]._intersect, None)
+        self.assertEqual(obj._intersect[1]._union[1].molecules, ['RNA'])
+        self.assertEqual(obj._intersect[1]._union[1].residues, [])
+        self.assertEqual(obj._intersect[1]._union[1].spins, [])
 
 
     def test_count_spins(self):




Related Messages


Powered by MHonArc, Updated Mon Apr 14 18:40:18 2008