mailr16625 - in /branches/uf_redesign/test_suite: gui_tests/ system_tests/ system_tests/scripts/


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

Header


Content

Posted by edward on June 04, 2012 - 14:18:
Author: bugman
Date: Mon Jun  4 14:18:25 2012
New Revision: 16625

URL: http://svn.gna.org/viewcvs/relax?rev=16625&view=rev
Log:
Preparation for the implementation of pipe bundle concept - addition of 
system and GUI tests.

This new pipe bundling concept is simply a way of grouping data pipes 
together.  This will be useful
for:

- Grouping and categorisation of data pipes when multiple analyses are 
performed.

- The model-free dauvergne_protocol auto-analysis will place all the data 
pipes it creates into one
bundle.

- For the GUI mode, analyses will be linked to pipe bundles rather than data 
pipes.  This will allow
switching data pipes to activate the correct analysis.


Added:
    branches/uf_redesign/test_suite/gui_tests/pipes.py
    branches/uf_redesign/test_suite/system_tests/scripts/pipe_bundle.py
Modified:
    branches/uf_redesign/test_suite/gui_tests/__init__.py
    branches/uf_redesign/test_suite/system_tests/pipes.py

Modified: branches/uf_redesign/test_suite/gui_tests/__init__.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/uf_redesign/test_suite/gui_tests/__init__.py?rev=16625&r1=16624&r2=16625&view=diff
==============================================================================
--- branches/uf_redesign/test_suite/gui_tests/__init__.py (original)
+++ branches/uf_redesign/test_suite/gui_tests/__init__.py Mon Jun  4 14:18:25 
2012
@@ -40,6 +40,7 @@
 from model_free import Mf
 from n_state_model import N_state_model
 from noe import Noe
+from pipes import Pipes
 from rx import Rx
 from state import State
 from test_suite.relax_test_loader import RelaxTestLoader as TestLoader
@@ -51,6 +52,7 @@
            'model_free',
            'n_state_model',
            'noe',
+           'pipes',
            'rx',
            'state']
 
@@ -115,6 +117,7 @@
             suite_array.append(TestLoader().loadTestsFromTestCase(Mf))
             
suite_array.append(TestLoader().loadTestsFromTestCase(N_state_model))
             suite_array.append(TestLoader().loadTestsFromTestCase(Noe))
+            suite_array.append(TestLoader().loadTestsFromTestCase(Pipes))
             suite_array.append(TestLoader().loadTestsFromTestCase(Rx))
             suite_array.append(TestLoader().loadTestsFromTestCase(State))
 

Added: branches/uf_redesign/test_suite/gui_tests/pipes.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/uf_redesign/test_suite/gui_tests/pipes.py?rev=16625&view=auto
==============================================================================
--- branches/uf_redesign/test_suite/gui_tests/pipes.py (added)
+++ branches/uf_redesign/test_suite/gui_tests/pipes.py Mon Jun  4 14:18:25 
2012
@@ -1,0 +1,39 @@
+###############################################################################
+#                                                                            
 #
+# Copyright (C) 2012 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  
 #
+#                                                                            
 #
+###############################################################################
+
+# Module docstring.
+"""GUI tests for pipe related activities."""
+
+# relax module imports.
+import dep_check
+from test_suite.gui_tests.base_classes import GuiTestCase
+from test_suite import system_tests
+
+
+class Pipes(GuiTestCase, system_tests.pipes.Pipes):
+    """Class for testing the pipe related functions in the GUI."""
+
+    def __init__(self, methodName=None):
+        """Set up the test case class for the system tests."""
+
+        # Force execution of the GuiTestCase __init__ method.
+        GuiTestCase.__init__(self, methodName)

Modified: branches/uf_redesign/test_suite/system_tests/pipes.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/uf_redesign/test_suite/system_tests/pipes.py?rev=16625&r1=16624&r2=16625&view=diff
==============================================================================
--- branches/uf_redesign/test_suite/system_tests/pipes.py (original)
+++ branches/uf_redesign/test_suite/system_tests/pipes.py Mon Jun  4 14:18:25 
2012
@@ -1,6 +1,6 @@
 
###############################################################################
 #                                                                            
 #
-# Copyright (C) 2006-2011 Edward d'Auvergne                                  
 #
+# Copyright (C) 2006-2012 Edward d'Auvergne                                  
 #
 #                                                                            
 #
 # This file is part of the program relax.                                    
 #
 #                                                                            
 #
@@ -20,13 +20,39 @@
 #                                                                            
 #
 
###############################################################################
 
+# Python module imports.
+from os import sep
+
 # relax module imports.
 from base_classes import SystemTestCase
 from data import Relax_data_store; ds = Relax_data_store()
+from generic_fns import pipes
+from status import Status; status = Status()
 
 
 class Pipes(SystemTestCase):
     """TestCase class for the functional tests of relax data pipes."""
+
+    def test_pipe_bundle(self):
+        """Test the pipe bundle concepts."""
+
+        # Execute the script.
+        self.script_exec(status.install_path + 
sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'pipe_bundle.py')
+
+        # Checks.
+        self.assertEqual(pipes.cdp_name(), None)
+        self.assertEqual(pipes.has_bundle('test bundle 1'), True)
+        self.assertEqual(pipes.has_bundle('test bundle 2'), True)
+        self.assertEqual(pipes.has_bundle('test bundle 3'), False)
+        self.assertEqual(pipes.bundle_names(), ['test bundle 1', 'test 
bundle 2'])
+        pipe_list = []
+        bundle_list = []
+        for pipe in pipes.pipe_loop():
+            pipe_list.append(pipe)
+            bundle_list.append(pipes.get_bundle(pipe))
+        self.assertEqual(pipe_list, ['test pipe 1', 'test pipe 2', 'test 
pipe 3', 'test pipe 4', 'test pipe 5', 'test pipe 6'])
+        self.assertEqual(bundle_list, ['test bundle 1', 'test bundle 1', 
'test bundle 1', 'test bundle 2', 'test bundle 2', 'test bundle 2'])
+
 
     def test_pipe_create(self):
         """Create a data pipe."""

Added: branches/uf_redesign/test_suite/system_tests/scripts/pipe_bundle.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/uf_redesign/test_suite/system_tests/scripts/pipe_bundle.py?rev=16625&view=auto
==============================================================================
--- branches/uf_redesign/test_suite/system_tests/scripts/pipe_bundle.py 
(added)
+++ branches/uf_redesign/test_suite/system_tests/scripts/pipe_bundle.py Mon 
Jun  4 14:18:25 2012
@@ -1,0 +1,26 @@
+# Script of testing out the pipe bundle concepts.
+
+# Create some data pipe with no bundle.
+self._execute_uf(uf_name='pipe.create', pipe_name='test pipe 1', 
pipe_type='mf', bundle=None)
+self._execute_uf(uf_name='pipe.create', pipe_name='test pipe 2', 
pipe_type='mf', bundle=None)
+self._execute_uf(uf_name='pipe.create', pipe_name='test pipe 3', 
pipe_type='mf', bundle=None)
+
+# Bundle the pipes.
+self._execute_uf(uf_name='pipe.bundle', bundle='test bundle 1', pipe='test 
pipe 1')
+self._execute_uf(uf_name='pipe.bundle', bundle='test bundle 1', pipe='test 
pipe 2')
+self._execute_uf(uf_name='pipe.bundle', bundle='test bundle 1', pipe='test 
pipe 3')
+
+# Create some data pipes in a new bundle.
+self._execute_uf(uf_name='pipe.create', pipe_name='test pipe 4', 
pipe_type='mf', bundle='test bundle 2')
+self._execute_uf(uf_name='pipe.create', pipe_name='test pipe 5', 
pipe_type='mf', bundle='test bundle 2')
+self._execute_uf(uf_name='pipe.create', pipe_name='test pipe 6', 
pipe_type='mf', bundle=None)
+self._execute_uf(uf_name='pipe.bundle', bundle='test bundle 2', pipe='test 
pipe 6')
+
+# Create the third set to delete.
+self._execute_uf(uf_name='pipe.create', pipe_name='test pipe 7', 
pipe_type='mf', bundle='test bundle 3')
+self._execute_uf(uf_name='pipe.create', pipe_name='test pipe 8', 
pipe_type='mf', bundle='test bundle 3')
+self._execute_uf(uf_name='pipe.delete', pipe_name='test pipe 7')
+self._execute_uf(uf_name='pipe.delete', pipe_name='test pipe 8')
+
+# Display everything.
+self._execute_uf(uf_name='pipe.display')




Related Messages


Powered by MHonArc, Updated Mon Jun 04 14:40:01 2012