~maus-detector-integration/maus/ckov_merge

« back to all changes in this revision

Viewing changes to tests/py_unit/test_mauscelery/test_mausworker.py

  • Committer: Chris Rogers
  • Date: 2012-03-05 16:24:30 UTC
  • mfrom: (340.32.8 release)
  • Revision ID: chris.rogers@stfc.ac.uk-20120305162430-5v76jvrfqmrw4z4u
MergeĀ releaseĀ 0.1.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
"""
 
2
Test class for mauscelery.mausworker module.
 
3
"""
 
4
 
 
5
#  This file is part of MAUS: http://micewww.pp.rl.ac.uk:8080/projects/maus
 
6
 
7
#  MAUS 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
#  MAUS 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 MAUS.  If not, see <http://www.gnu.org/licenses/>.
 
19
 
 
20
import unittest
 
21
 
 
22
from mauscelery.state import MausConfiguration
 
23
from mauscelery.mausworker import get_maus_configuration
 
24
 
 
25
class GetMausConfigPanelTestCase(unittest.TestCase): # pylint: disable=R0904, C0301
 
26
    """
 
27
    Test class for mauscelery.mausworker.get_maus_configuration method. 
 
28
    """
 
29
 
 
30
    def test_panel_get_config(self):
 
31
        """ 
 
32
        Test the get_maus_configuration panel operation.
 
33
        @param self Object reference.
 
34
        """
 
35
        MausConfiguration.transform = "MapPyTestMap"
 
36
        MausConfiguration.configuration = "{test}"
 
37
        config = get_maus_configuration(None)
 
38
        self.assertTrue(config.has_key("config_id"), 
 
39
            "Missing config_id key")
 
40
        self.assertEquals(MausConfiguration.config_id, 
 
41
            config["config_id"], "Unexpected config_id")
 
42
        self.assertTrue(config.has_key("configuration"), 
 
43
            "Missing configuration key")
 
44
        self.assertEquals(MausConfiguration.configuration, 
 
45
            config["configuration"], "Unexpected configuration")
 
46
        self.assertTrue(config.has_key("transform"),
 
47
            "Missing transform")
 
48
        self.assertEquals(MausConfiguration.transform,
 
49
            config["transform"], "Unexpected transform")
 
50
 
 
51
if __name__ == '__main__':
 
52
    unittest.main()