示例#1
0
 def testValidate_003(self):
     """
     Test validate on a non-empty amazons3 section with no values filled in.
     """
     config = LocalConfig()
     config.amazons3 = AmazonS3Config(None)
     self.assertRaises(ValueError, config.validate)
示例#2
0
 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()
示例#3
0
 def testValidate_001(self):
     """
     Test validate on a None amazons3 section.
     """
     config = LocalConfig()
     config.amazons3 = None
     self.assertRaises(ValueError, config.validate)
示例#4
0
 def testValidate_002(self):
     """
     Test validate on an empty amazons3 section.
     """
     config = LocalConfig()
     config.amazons3 = AmazonS3Config()
     self.assertRaises(ValueError, config.validate)
示例#5
0
 def testConstructor_005(self):
     """
     Test assignment of amazons3 attribute, valid value.
     """
     config = LocalConfig()
     config.amazons3 = AmazonS3Config()
     self.assertEqual(AmazonS3Config(), config.amazons3)
示例#6
0
 def testConstructor_004(self):
     """
     Test assignment of amazons3 attribute, None value.
     """
     config = LocalConfig()
     config.amazons3 = None
     self.assertEqual(None, config.amazons3)
示例#7
0
 def testAddConfig_002(self):
     """
     Test with values set.
     """
     amazons3 = AmazonS3Config(True, "bucket", "encrypt", 1, 2)
     config = LocalConfig()
     config.amazons3 = amazons3
     self.validateAddConfig(config)
示例#8
0
 def testAddConfig_001(self):
     """
     Test with empty config document.
     """
     amazons3 = AmazonS3Config()
     config = LocalConfig()
     config.amazons3 = amazons3
     self.validateAddConfig(config)
示例#9
0
    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.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)
示例#10
0
    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.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)
示例#11
0
 def testComparison_003(self):
     """
     Test comparison of two differing objects, amazons3 differs (one None).
     """
     config1 = LocalConfig()
     config2 = LocalConfig()
     config2.amazons3 = AmazonS3Config()
     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)