Example #1
0
 def testDefaults(self):
     """Test that C++ Control object defaults are correctly used as defaults
     for Config objects."""
     config = testLib.ConfigObject()
     control = testLib.ControlObject()
     self.assertTrue(
         testLib.checkControl(control, config.foo, config.bar.list()))
Example #2
0
 def testMakeControl(self):
     """Test making a C++ Control object from a Config object."""
     config = testLib.ConfigObject()
     config.foo = 2
     config.bar.append("baz")
     control = config.makeControl()
     self.assertTrue(testLib.checkControl(control, config.foo, config.bar.list()))
Example #3
0
 def testReadControl(self):
     """Test reading the values from a C++ Control object into a Config object."""
     control = testLib.ControlObject()
     control.foo = 3
     control.bar = ["zot", "yox"]
     config = testLib.ConfigObject()
     config.readControl(control)
     self.assertTrue(testLib.checkControl(control, config.foo, config.bar.list()))
Example #4
0
 def testPickle(self):
     """Test that C++ Control object pickles correctly"""
     config = testLib.ConfigObject()
     new = pickle.loads(pickle.dumps(config))
     self.assertTrue(config.compare(new))
     self.assertTrue(new.compare(config))