def testConstructor_005(self):
     """
   Test assignment of amazons3 attribute, valid value.
   """
     config = LocalConfig()
     config.amazons3 = AmazonS3Config()
     self.failUnlessEqual(AmazonS3Config(), config.amazons3)
 def testComparison_003(self):
     """
   Test comparison of two differing objects, warnMidnite differs.
   """
     amazons31 = AmazonS3Config(warnMidnite=False)
     amazons32 = AmazonS3Config(warnMidnite=True)
     self.failIfEqual(amazons31, amazons32)
     self.failUnless(not amazons31 == amazons32)
     self.failUnless(amazons31 < amazons32)
     self.failUnless(amazons31 <= amazons32)
     self.failUnless(not amazons31 > amazons32)
     self.failUnless(not amazons31 >= amazons32)
     self.failUnless(amazons31 != amazons32)
 def testComparison_005(self):
     """
   Test comparison of two differing objects, s3Bucket differs.
   """
     amazons31 = AmazonS3Config(s3Bucket="bucket1")
     amazons32 = AmazonS3Config(s3Bucket="bucket2")
     self.failIfEqual(amazons31, amazons32)
     self.failUnless(not amazons31 == amazons32)
     self.failUnless(amazons31 < amazons32)
     self.failUnless(amazons31 <= amazons32)
     self.failUnless(not amazons31 > amazons32)
     self.failUnless(not amazons31 >= amazons32)
     self.failUnless(amazons31 != amazons32)
 def testComparison_007(self):
     """
   Test comparison of two differing objects, encryptCommand differs.
   """
     amazons31 = AmazonS3Config(encryptCommand="encrypt1")
     amazons32 = AmazonS3Config(encryptCommand="encrypt2")
     self.failIfEqual(amazons31, amazons32)
     self.failUnless(not amazons31 == amazons32)
     self.failUnless(amazons31 < amazons32)
     self.failUnless(amazons31 <= amazons32)
     self.failUnless(not amazons31 > amazons32)
     self.failUnless(not amazons31 >= amazons32)
     self.failUnless(amazons31 != amazons32)
 def testComparison_008(self):
     """
   Test comparison of two differing objects, fullBackupSizeLimit differs (one None).
   """
     amazons31 = AmazonS3Config()
     amazons32 = AmazonS3Config(fullBackupSizeLimit=1L)
     self.failIfEqual(amazons31, amazons32)
     self.failUnless(not amazons31 == amazons32)
     self.failUnless(amazons31 < amazons32)
     self.failUnless(amazons31 <= amazons32)
     self.failUnless(not amazons31 > amazons32)
     self.failUnless(not amazons31 >= amazons32)
     self.failUnless(amazons31 != amazons32)
 def testComparison_011(self):
     """
   Test comparison of two differing objects, incrementalBackupSizeLimit differs.
   """
     amazons31 = AmazonS3Config(incrementalBackupSizeLimit=1L)
     amazons32 = AmazonS3Config(incrementalBackupSizeLimit=2L)
     self.failIfEqual(amazons31, amazons32)
     self.failUnless(not amazons31 == amazons32)
     self.failUnless(amazons31 < amazons32)
     self.failUnless(amazons31 <= amazons32)
     self.failUnless(not amazons31 > amazons32)
     self.failUnless(not amazons31 >= amazons32)
     self.failUnless(amazons31 != amazons32)
 def testComparison_002(self):
     """
   Test comparison of two identical objects, all attributes non-None.
   """
     amazons31 = AmazonS3Config(True, "bucket", "encrypt", 1, 2)
     amazons32 = AmazonS3Config(True, "bucket", "encrypt", 1, 2)
     self.failUnlessEqual(amazons31, amazons32)
     self.failUnless(amazons31 == amazons32)
     self.failUnless(not amazons31 < amazons32)
     self.failUnless(amazons31 <= amazons32)
     self.failUnless(not amazons31 > amazons32)
     self.failUnless(amazons31 >= amazons32)
     self.failUnless(not amazons31 != amazons32)
 def testComparison_001(self):
     """
   Test comparison of two identical objects, all attributes None.
   """
     amazons31 = AmazonS3Config()
     amazons32 = AmazonS3Config()
     self.failUnlessEqual(amazons31, amazons32)
     self.failUnless(amazons31 == amazons32)
     self.failUnless(not amazons31 < amazons32)
     self.failUnless(amazons31 <= amazons32)
     self.failUnless(not amazons31 > amazons32)
     self.failUnless(amazons31 >= amazons32)
     self.failUnless(not amazons31 != amazons32)
 def testStringFuncs_001(self):
     """
   Just make sure that the string functions don't have errors (i.e. bad variable names).
   """
     obj = AmazonS3Config()
     obj.__repr__()
     obj.__str__()
 def testValidate_003(self):
     """
   Test validate on a non-empty amazons3 section with no values filled in.
   """
     config = LocalConfig()
     config.amazons3 = AmazonS3Config(None)
     self.failUnlessRaises(ValueError, config.validate)
 def testValidate_002(self):
     """
   Test validate on an empty amazons3 section.
   """
     config = LocalConfig()
     config.amazons3 = AmazonS3Config()
     self.failUnlessRaises(ValueError, config.validate)
 def testValidate_005(self):
     """
   Test validate on a non-empty amazons3 section with valid values filled in.
   """
     config = LocalConfig()
     config.amazons3 = AmazonS3Config(True, "bucket")
     config.validate()
 def testConstructor_007(self):
     """
   Test assignment of s3Bucket attribute, invalid value (empty).
   """
     amazons3 = AmazonS3Config()
     self.failUnlessEqual(None, amazons3.s3Bucket)
     self.failUnlessAssignRaises(ValueError, amazons3, "s3Bucket", "")
     self.failUnlessEqual(None, amazons3.s3Bucket)
 def testAddConfig_002(self):
     """
   Test with values set.
   """
     amazons3 = AmazonS3Config(True, "bucket", "encrypt", 1, 2)
     config = LocalConfig()
     config.amazons3 = amazons3
     self.validateAddConfig(config)
    def testComparison_002(self):
        """
      Test comparison of two identical objects, all attributes non-None.
      """
        config1 = LocalConfig()
        config1.amazons3 = AmazonS3Config()

        config2 = LocalConfig()
        config2.amazons3 = AmazonS3Config()

        self.failUnlessEqual(config1, config2)
        self.failUnless(config1 == config2)
        self.failUnless(not config1 < config2)
        self.failUnless(config1 <= config2)
        self.failUnless(not config1 > config2)
        self.failUnless(config1 >= config2)
        self.failUnless(not config1 != config2)
 def testAddConfig_001(self):
     """
   Test with empty config document.
   """
     amazons3 = AmazonS3Config()
     config = LocalConfig()
     config.amazons3 = amazons3
     self.validateAddConfig(config)
    def testComparison_004(self):
        """
      Test comparison of two differing objects, s3Bucket differs.
      """
        config1 = LocalConfig()
        config1.amazons3 = AmazonS3Config(True, "bucket1", "encrypt", 1, 2)

        config2 = LocalConfig()
        config2.amazons3 = AmazonS3Config(True, "bucket2", "encrypt", 1, 2)

        self.failIfEqual(config1, config2)
        self.failUnless(not config1 == config2)
        self.failUnless(config1 < config2)
        self.failUnless(config1 <= config2)
        self.failUnless(not config1 > config2)
        self.failUnless(not config1 >= config2)
        self.failUnless(config1 != config2)
 def testConstructor_014(self):
     """
   Test assignment of incrementalBackupSizeLimit attribute, None value.
   """
     amazons3 = AmazonS3Config(incrementalBackupSizeLimit=100)
     self.failUnlessEqual(100, amazons3.incrementalBackupSizeLimit)
     amazons3.incrementalBackupSizeLimit = None
     self.failUnlessEqual(None, amazons3.incrementalBackupSizeLimit)
 def testConstructor_006(self):
     """
   Test assignment of s3Bucket attribute, valid value.
   """
     amazons3 = AmazonS3Config()
     self.failUnlessEqual(None, amazons3.s3Bucket)
     amazons3.s3Bucket = "bucket"
     self.failUnlessEqual("bucket", amazons3.s3Bucket)
 def testConstructor_009(self):
     """
   Test assignment of encryptCommand attribute, valid value.
   """
     amazons3 = AmazonS3Config()
     self.failUnlessEqual(None, amazons3.encryptCommand)
     amazons3.encryptCommand = "encrypt"
     self.failUnlessEqual("encrypt", amazons3.encryptCommand)
 def testConstructor_010(self):
     """
   Test assignment of encryptCommand attribute, invalid value (empty).
   """
     amazons3 = AmazonS3Config()
     self.failUnlessEqual(None, amazons3.encryptCommand)
     self.failUnlessAssignRaises(ValueError, amazons3, "encryptCommand", "")
     self.failUnlessEqual(None, amazons3.encryptCommand)
 def testConstructor_016(self):
     """
   Test assignment of incrementalBackupSizeLimit attribute, invalid value.
   """
     amazons3 = AmazonS3Config()
     self.failUnlessEqual(None, amazons3.incrementalBackupSizeLimit)
     self.failUnlessAssignRaises(ValueError, amazons3,
                                 "incrementalBackupSizeLimit", "xxx")
     self.failUnlessEqual(None, amazons3.incrementalBackupSizeLimit)
 def testConstructor_012f(self):
     """
   Test assignment of fullBackupSizeLimit attribute, valid byte quantity value.
   """
     amazons3 = AmazonS3Config()
     self.failUnlessEqual(None, amazons3.fullBackupSizeLimit)
     amazons3.fullBackupSizeLimit = ByteQuantity(600, UNIT_MBYTES)
     self.failUnlessEqual(ByteQuantity(600, UNIT_MBYTES),
                          amazons3.fullBackupSizeLimit)
     self.failUnlessEqual(629145600.0, amazons3.fullBackupSizeLimit.bytes)
 def testConstructor_015a(self):
     """
   Test assignment of incrementalBackupSizeLimit attribute, valid int value.
   """
     amazons3 = AmazonS3Config()
     self.failUnlessEqual(None, amazons3.incrementalBackupSizeLimit)
     amazons3.incrementalBackupSizeLimit = 15
     self.failUnlessEqual(15, amazons3.incrementalBackupSizeLimit)
     self.failUnlessEqual(ByteQuantity(15, UNIT_BYTES),
                          amazons3.incrementalBackupSizeLimit)
 def testConstructor_015d(self):
     """
   Test assignment of incrementalBackupSizeLimit attribute, valid string value.
   """
     amazons3 = AmazonS3Config()
     self.failUnlessEqual(None, amazons3.incrementalBackupSizeLimit)
     amazons3.incrementalBackupSizeLimit = "7516192768"
     self.failUnlessEqual(7516192768, amazons3.incrementalBackupSizeLimit)
     self.failUnlessEqual(ByteQuantity("7516192768", UNIT_BYTES),
                          amazons3.incrementalBackupSizeLimit)
 def testConstructor_002(self):
     """
   Test constructor with all values filled in, with valid values.
   """
     amazons3 = AmazonS3Config(True, "bucket", "encrypt", 1, 2)
     self.failUnlessEqual(True, amazons3.warnMidnite)
     self.failUnlessEqual("bucket", amazons3.s3Bucket)
     self.failUnlessEqual("encrypt", amazons3.encryptCommand)
     self.failUnlessEqual(1L, amazons3.fullBackupSizeLimit)
     self.failUnlessEqual(2L, amazons3.incrementalBackupSizeLimit)
 def testConstructor_003(self):
     """
   Test assignment of warnMidnite attribute, valid value (real boolean).
   """
     amazons3 = AmazonS3Config()
     self.failUnlessEqual(False, amazons3.warnMidnite)
     amazons3.warnMidnite = True
     self.failUnlessEqual(True, amazons3.warnMidnite)
     amazons3.warnMidnite = False
     self.failUnlessEqual(False, amazons3.warnMidnite)
 def testConstructor_012c(self):
     """
   Test assignment of fullBackupSizeLimit attribute, valid float value.
   """
     amazons3 = AmazonS3Config()
     self.failUnlessEqual(None, amazons3.fullBackupSizeLimit)
     amazons3.fullBackupSizeLimit = 7516192768.0
     self.failUnlessEqual(7516192768.0, amazons3.fullBackupSizeLimit)
     self.failUnlessEqual(ByteQuantity(7516192768.0, UNIT_BYTES),
                          amazons3.fullBackupSizeLimit)
 def testConstructor_001(self):
     """
   Test constructor with no values filled in.
   """
     amazons3 = AmazonS3Config()
     self.failUnlessEqual(False, amazons3.warnMidnite)
     self.failUnlessEqual(None, amazons3.s3Bucket)
     self.failUnlessEqual(None, amazons3.encryptCommand)
     self.failUnlessEqual(None, amazons3.fullBackupSizeLimit)
     self.failUnlessEqual(None, amazons3.incrementalBackupSizeLimit)
 def testConstructor_015e(self):
     """
   Test assignment of incrementalBackupSizeLimit attribute, valid byte quantity value.
   """
     amazons3 = AmazonS3Config()
     self.failUnlessEqual(None, amazons3.incrementalBackupSizeLimit)
     amazons3.incrementalBackupSizeLimit = ByteQuantity(2.5, UNIT_GBYTES)
     self.failUnlessEqual(ByteQuantity(2.5, UNIT_GBYTES),
                          amazons3.incrementalBackupSizeLimit)
     self.failUnlessEqual(2684354560.0,
                          amazons3.incrementalBackupSizeLimit.bytes)