Package test_suite :: Package unit_tests :: Package _prompt :: Module test_uf_objects
[hide private]
[frames] | no frames]

Source Code for Module test_suite.unit_tests._prompt.test_uf_objects

 1  ############################################################################### 
 2  #                                                                             # 
 3  # Copyright (C) 2012 Edward d'Auvergne                                        # 
 4  #                                                                             # 
 5  # This file is part of the program relax.                                     # 
 6  #                                                                             # 
 7  # relax is free software; you can redistribute it and/or modify               # 
 8  # it under the terms of the GNU General Public License as published by        # 
 9  # the Free Software Foundation; either version 2 of the License, or           # 
10  # (at your option) any later version.                                         # 
11  #                                                                             # 
12  # relax is distributed in the hope that it will be useful,                    # 
13  # but WITHOUT ANY WARRANTY; without even the implied warranty of              # 
14  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               # 
15  # GNU General Public License for more details.                                # 
16  #                                                                             # 
17  # You should have received a copy of the GNU General Public License           # 
18  # along with relax; if not, write to the Free Software                        # 
19  # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA   # 
20  #                                                                             # 
21  ############################################################################### 
22   
23  # Module docstring. 
24  """Unit test module for the prompt.uf_objects module.""" 
25   
26  # Python module imports. 
27  from unittest import TestCase 
28   
29  # relax module imports. 
30  from prompt.uf_objects import Class_container, Uf_object 
31  from user_functions.data import Uf_info; uf_info = Uf_info() 
32   
33   
34 -class Test_uf_objects(TestCase):
35 """Unit test case for the prompt.uf_objects module.""" 36
37 - def test_uf_class_build_doc(self):
38 """Test the _build_doc() method of all the prompt user function classes.""" 39 40 # Loop over the classes. 41 for name, data in uf_info.class_loop(): 42 # Print out. 43 print(name) 44 45 # Generate a new container. 46 obj = Class_container(name, data.title) 47 48 # Create the documentation and print it. 49 text = obj._build_doc()
50 51
53 """Test the _build_doc() method of all the prompt user function objects.""" 54 55 # Loop over the classes. 56 for name, data in uf_info.uf_loop(): 57 # Print out. 58 print(name) 59 60 # Generate a new container. 61 obj = Uf_object(name, title=data.title, kargs=data.kargs, backend=data.backend, desc=data.desc) 62 63 # Create the documentation and print it. 64 text = obj._build_doc()
65