~maus-maintainers/maus/release-candidate

« back to all changes in this revision

Viewing changes to tests/py_unit/test_libMausCpp.py

  • Committer: Chris Rogers
  • Date: 2012-07-18 16:14:23 UTC
  • mto: (659.64.1 _maus_merge)
  • mto: This revision was merged to the branch mainline in revision 688.
  • Revision ID: chris.rogers@stfc.ac.uk-20120718161423-noem1k493xw4evdj
Globals improvements, clean up

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
#  You should have received a copy of the GNU General Public License
14
14
#  along with MAUS.  If not, see <http://www.gnu.org/licenses/>.
15
15
 
 
16
# pylint: disable=C0103
 
17
 
16
18
"""
17
19
Test libMausCpp
18
20
"""
19
21
 
20
22
import StringIO
21
 
import json
22
23
import unittest
23
24
 
24
25
import Configuration
25
26
import libMausCpp
26
27
 
27
 
class LibMausCppTestCase(unittest.TestCase):
 
28
class LibMausCppTestCase(unittest.TestCase): # pylint: disable=R0904
28
29
    """Test libMausCpp"""
29
30
 
30
 
    def setUp(self):
 
31
    def setUp(self): # pylint: disable=C0103
31
32
        """Set up test"""
32
33
        config_options = StringIO.StringIO(unicode("""
33
34
simulation_geometry_filename = "Test.dat"
60
61
    def test_get_field_value(self):
61
62
        """Test libMausCpp.Field.get_field_value(...)"""
62
63
        libMausCpp.initialise(self.config)
63
 
        for x in range(10):
64
 
            field_value = libMausCpp.Field.get_field_value(x, x, x, x)
 
64
        for x_pos in range(10):
 
65
            field_value = libMausCpp.Field.get_field_value\
 
66
                                                    (x_pos, x_pos, x_pos, x_pos)
65
67
            for i in range(6):
66
68
                self.assertAlmostEqual(field_value[i], 0., 1e-12)
67
69
        libMausCpp.destruct()