def testValidate_004(self): """ Test validate on a non-empty split section with only one value filled in. """ config = LocalConfig() config.split = SplitConfig(ByteQuantity("1.00", UNIT_MBYTES), None) self.assertRaises(ValueError, config.validate) config.split = SplitConfig(None, ByteQuantity("1.00", UNIT_MBYTES)) self.assertRaises(ValueError, config.validate)
def testValidate_005(self): """ Test validate on a non-empty split section with valid values filled in. """ config = LocalConfig() config.split = SplitConfig(ByteQuantity("1.00", UNIT_MBYTES), ByteQuantity("1.00", UNIT_MBYTES)) config.validate()
def testValidate_003(self): """ Test validate on a non-empty split section with no values filled in. """ config = LocalConfig() config.split = SplitConfig(None, None) self.assertRaises(ValueError, config.validate)
def testValidate_001(self): """ Test validate on a None split section. """ config = LocalConfig() config.split = None self.assertRaises(ValueError, config.validate)
def testValidate_002(self): """ Test validate on an empty split section. """ config = LocalConfig() config.split = SplitConfig() self.assertRaises(ValueError, config.validate)
def testConstructor_005(self): """ Test assignment of split attribute, valid value. """ config = LocalConfig() config.split = SplitConfig() self.assertEqual(SplitConfig(), config.split)
def testConstructor_004(self): """ Test assignment of split attribute, None value. """ config = LocalConfig() config.split = None self.assertEqual(None, config.split)
def testAddConfig_005(self): """ Test with values set, GB values. """ split = SplitConfig(ByteQuantity("12", UNIT_GBYTES), ByteQuantity("63352", UNIT_GBYTES)) config = LocalConfig() config.split = split self.validateAddConfig(config)
def testAddConfig_002(self): """ Test with values set, byte values. """ split = SplitConfig(ByteQuantity("57521.0", UNIT_BYTES), ByteQuantity("121231", UNIT_BYTES)) config = LocalConfig() config.split = split self.validateAddConfig(config)
def testAddConfig_001(self): """ Test with empty config document. """ split = SplitConfig() config = LocalConfig() config.split = split self.validateAddConfig(config)
def testComparison_004(self): """ Test comparison of two differing objects, split differs. """ config1 = LocalConfig() config1.split = SplitConfig(sizeLimit=ByteQuantity("0.1", UNIT_MBYTES)) config2 = LocalConfig() config2.split = SplitConfig(sizeLimit=ByteQuantity("1.00", UNIT_MBYTES)) self.assertNotEqual(config1, config2) self.assertTrue(not config1 == config2) self.assertTrue(config1 < config2) self.assertTrue(config1 <= config2) self.assertTrue(not config1 > config2) self.assertTrue(not config1 >= config2) self.assertTrue(config1 != config2)
def testComparison_002(self): """ Test comparison of two identical objects, all attributes non-None. """ config1 = LocalConfig() config1.split = SplitConfig() config2 = LocalConfig() config2.split = SplitConfig() self.assertEqual(config1, config2) self.assertTrue(config1 == config2) self.assertTrue(not config1 < config2) self.assertTrue(config1 <= config2) self.assertTrue(not config1 > config2) self.assertTrue(config1 >= config2) self.assertTrue(not config1 != config2)
def testComparison_003(self): """ Test comparison of two differing objects, split differs (one None). """ config1 = LocalConfig() config2 = LocalConfig() config2.split = SplitConfig() self.assertNotEqual(config1, config2) self.assertTrue(not config1 == config2) self.assertTrue(config1 < config2) self.assertTrue(config1 <= config2) self.assertTrue(not config1 > config2) self.assertTrue(not config1 >= config2) self.assertTrue(config1 != config2)