Trees | Indices | Help |
|
---|
|
1 ############################################################################### 2 # # 3 # Copyright (C) 2007-2009,2024 Edward d'Auvergne # 4 # # 5 # This file is part of the program relax (http://www.nmr-relax.com). # 6 # # 7 # This program 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 3 of the License, or # 10 # (at your option) any later version. # 11 # # 12 # This program 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 this program. If not, see <http://www.gnu.org/licenses/>. # 19 # # 20 ############################################################################### 21 22 # Python module imports. 23 from os import sep 24 import sys 25 26 # relax module imports. 27 import data_store 28 from data_store import Relax_data_store; ds = Relax_data_store() 29 from test_suite.unit_tests.package_checking import PackageTestCase 30 31 34 3537 """Unit tests for the data_store package.""" 389440 """Set up a complex relax data store.""" 41 42 # Package info. 43 self.package = data_store 44 self.package_name = 'data_store' 45 self.package_path = sys.path[0] + sep + 'data_store' 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.assertTrue('new' in ds)65 6668 """Unit test for the validity of the __repr__() method.""" 69 70 # Test that __repr__() returns a string. 71 self.assertTrue(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.assertTrue(not hasattr(ds, 'test')) 85 86 # Test that the object methods still exist. 87 self.assertTrue(hasattr(ds, '__new__')) 88 self.assertTrue(hasattr(ds, '__repr__')) 89 self.assertTrue(hasattr(ds, '__reset__')) 90 self.assertTrue(hasattr(ds, 'add')) 91 92 # Test that the object's initial objects still exist. 93 self.assertTrue(hasattr(ds, 'current_pipe'))
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Sat Jun 8 10:45:16 2024 | http://epydoc.sourceforge.net |