Ejemplo n.º 1
0
 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)
Ejemplo n.º 2
0
 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()
Ejemplo n.º 3
0
 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)
Ejemplo n.º 4
0
 def testValidate_001(self):
     """
     Test validate on a None split section.
     """
     config = LocalConfig()
     config.split = None
     self.assertRaises(ValueError, config.validate)
Ejemplo n.º 5
0
 def testValidate_002(self):
     """
     Test validate on an empty split section.
     """
     config = LocalConfig()
     config.split = SplitConfig()
     self.assertRaises(ValueError, config.validate)
Ejemplo n.º 6
0
 def testConstructor_005(self):
     """
     Test assignment of split attribute, valid value.
     """
     config = LocalConfig()
     config.split = SplitConfig()
     self.assertEqual(SplitConfig(), config.split)
Ejemplo n.º 7
0
 def testConstructor_004(self):
     """
     Test assignment of split attribute, None value.
     """
     config = LocalConfig()
     config.split = None
     self.assertEqual(None, config.split)
Ejemplo n.º 8
0
 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)
Ejemplo n.º 9
0
 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)
Ejemplo n.º 10
0
 def testAddConfig_001(self):
     """
     Test with empty config document.
     """
     split = SplitConfig()
     config = LocalConfig()
     config.split = split
     self.validateAddConfig(config)
Ejemplo n.º 11
0
    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)
Ejemplo n.º 12
0
    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)
Ejemplo n.º 13
0
 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)