Trees | Indices | Help |
|
---|
|
1 ############################################################################### 2 # # 3 # Copyright (C) 2007-2011 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 # Python module imports. 24 from os import sep 25 import sys 26 27 # relax module imports. 28 import data; ds = data.Relax_data_store() 29 from test_suite.unit_tests.package_checking import PackageTestCase 30 31 34 3537 """Unit tests for the data.Relax_data_store class.""" 389440 """Set up a complex relax data store.""" 41 42 # Package info. 43 self.package = data 44 self.package_name = 'data' 45 self.package_path = sys.path[0] + sep + 'data' 46 47 # Add an empty data container as a new pipe. 48 ds['empty'] = Empty_container() 49 50 # Add an object to the empty data container. 51 ds['empty'].x = 1 52 53 # Add an object to the data store object. 54 ds.test = 155 5658 """Unit test for testing the addition of a new data pipe by the 'add()' method.""" 59 60 # Add a new data pipe. 61 ds.add(pipe_name='new', pipe_type='mf') 62 63 # Test that the new data pipe exists. 64 self.assert_('new' in ds)65 6668 """Unit test for the validity of the __repr__() method.""" 69 70 # Test that __repr__() returns a string. 71 self.assert_(type(ds.__repr__()), str)72 7375 """Unit test for the __reset__() class method.""" 76 77 # Execute the reset method. 78 ds.__reset__() 79 80 # Test that there are no keys. 81 self.assertEqual(list(ds.keys()), []) 82 83 # Test that the object ds.test is deleted. 84 self.assert_(not hasattr(ds, 'test')) 85 86 # Test that the object methods still exist. 87 self.assert_(hasattr(ds, '__new__')) 88 self.assert_(hasattr(ds, '__repr__')) 89 self.assert_(hasattr(ds, '__reset__')) 90 self.assert_(hasattr(ds, 'add')) 91 92 # Test that the object's initial objects still exist. 93 self.assert_(hasattr(ds, 'current_pipe'))
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Wed Apr 10 13:32:49 2013 | http://epydoc.sourceforge.net |