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()))
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()))
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()))
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))