Пример #1
0
 def testValidate_009(self):
     """
     Test validate on a non-empty postgresql section, with user=None.
     """
     config = LocalConfig()
     config.postgresql = PostgresqlConfig(None, "gzip", True, None)
     config.validate()
Пример #2
0
 def testAddConfig_003(self):
     """
     Test with no databases, all other values filled in, all=True.
     """
     config = LocalConfig()
     config.postgresql = PostgresqlConfig("user", "none", True, None)
     self.validateAddConfig(config)
Пример #3
0
 def testValidate_007(self):
     """
     Test validate on a non-empty postgresql section, all=False, empty databases.
     """
     config = LocalConfig()
     config.postgresql = PostgresqlConfig("user", "bzip2", False, [])
     self.assertRaises(ValueError, config.validate)
Пример #4
0
 def testValidate_004(self):
     """
     Test validate on a non-empty postgresql section, all=True, empty databases.
     """
     config = LocalConfig()
     config.postgresql = PostgresqlConfig("user", "none", True, [])
     config.validate()
Пример #5
0
 def testValidate_006(self):
     """
     Test validate on a non-empty postgresql section, all=False, databases=None.
     """
     config = LocalConfig()
     config.postgresql = PostgresqlConfig("user", "gzip", False, None)
     self.assertRaises(ValueError, config.validate)
Пример #6
0
 def testValidate_002(self):
     """
     Test validate on an empty postgresql section.
     """
     config = LocalConfig()
     config.postgresql = PostgresqlConfig()
     self.assertRaises(ValueError, config.validate)
Пример #7
0
 def testConstructor_005(self):
     """
     Test assignment of postgresql attribute, valid value.
     """
     config = LocalConfig()
     config.postgresql = PostgresqlConfig()
     self.assertEqual(PostgresqlConfig(), config.postgresql)
Пример #8
0
 def testValidate_001(self):
     """
     Test validate on a None postgresql section.
     """
     config = LocalConfig()
     config.postgresql = None
     self.assertRaises(ValueError, config.validate)
Пример #9
0
 def testConstructor_004(self):
     """
     Test assignment of postgresql attribute, None value.
     """
     config = LocalConfig()
     config.postgresql = None
     self.assertEqual(None, config.postgresql)
Пример #10
0
 def testAddConfig_004(self):
     """
     Test with no databases, all other values filled in, all=False.
     """
     config = LocalConfig()
     config.postgresql = PostgresqlConfig("user", "gzip", False, None)
     self.validateAddConfig(config)
Пример #11
0
 def testValidate_003(self):
     """
     Test validate on a non-empty postgresql section, all=True, databases=None.
     """
     config = LocalConfig()
     config.postgresql = PostgresqlConfig("user", "gzip", True, None)
     config.validate()
Пример #12
0
 def testValidate_008(self):
     """
     Test validate on a non-empty postgresql section, all=False, non-empty databases.
     """
     config = LocalConfig()
     config.postgresql = PostgresqlConfig("user", "gzip", False,
                                          ["whatever"])
     config.validate()
Пример #13
0
 def testAddConfig_009(self):
     """
     Test with multiple databases, user=None but all other values filled in, all=False.
     """
     config = LocalConfig()
     config.postgresql = PostgresqlConfig(None, "gzip", True,
                                          ["database1", "database2"])
     self.validateAddConfig(config)
Пример #14
0
    def testComparison_004(self):
        """
        Test comparison of two differing objects, postgresql differs.
        """
        config1 = LocalConfig()
        config1.postgresql = PostgresqlConfig(user="******")

        config2 = LocalConfig()
        config2.postgresql = PostgresqlConfig(user="******")

        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)
Пример #15
0
    def testComparison_002(self):
        """
        Test comparison of two identical objects, all attributes non-None.
        """
        config1 = LocalConfig()
        config1.postgresql = PostgresqlConfig()

        config2 = LocalConfig()
        config2.postgresql = PostgresqlConfig()

        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)
Пример #16
0
 def testAddConfig_005(self):
     """
     Test with single database, all other values filled in, all=True.
     """
     config = LocalConfig()
     config.postgresql = PostgresqlConfig("user", "bzip2", True,
                                          ["database"])
     self.validateAddConfig(config)
Пример #17
0
 def testAddConfig_006(self):
     """
     Test with single database, all other values filled in, all=False.
     """
     config = LocalConfig()
     config.postgresql = PostgresqlConfig("user", "none", False,
                                          ["database"])
     self.validateAddConfig(config)