Trees | Indices | Help |
|
---|
|
1 ############################################################################### 2 # # 3 # Copyright (C) 2008 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 unittest import TestCase 24 25 # relax module imports. 26 from data_store.pipe_container import PipeContainer 27 2830 """Unit tests for the data.pipe_container relax module.""" 318233 """Create a data pipe structure for testing all the object methods.""" 34 35 # The initial empty structure. 36 self.data_pipe = PipeContainer()37 38 43 4446 """Test the PipeContainer.__repr__() method.""" 47 48 # Add a few objects. 49 self.data_pipe.x = 10 50 self.data_pipe.chi2 = PipeContainer() 51 52 # Test that __repr__() returns a string. 53 self.assertTrue(type(self.data_pipe.__repr__()), str)54 5557 """Test the PipeContainer.__repr__() method for an empty data pipe.""" 58 59 # Test that __repr__() returns a string. 60 self.assertTrue(type(self.data_pipe.__repr__()), str)61 6264 """Tests for the PipeContainer.is_empty() method.""" 65 66 # The newly initialised data pipe should be empty. 67 self.assertTrue(self.data_pipe.is_empty()) 68 69 # Add an object. 70 self.data_pipe.x = 1 71 self.assertTrue(not self.data_pipe.is_empty()) 72 73 # Reset the data pipe, and modify an object. 74 self.setUp() 75 self.data_pipe.mol[0].name = 'Ap4Aase' 76 self.assertTrue(not self.data_pipe.is_empty()) 77 78 # The pipe type can be set in the empty data pipe. 79 self.setUp() 80 self.data_pipe.pipe_type = 'mf' 81 self.assertTrue(self.data_pipe.is_empty())
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Sat Jun 8 10:45:43 2024 | http://epydoc.sourceforge.net |