Exemplo n.º 1
0
 def testConstructor_005(self):
     """
     Test assignment of postgresql attribute, valid value.
     """
     config = LocalConfig()
     config.postgresql = PostgresqlConfig()
     self.assertEqual(PostgresqlConfig(), config.postgresql)
Exemplo n.º 2
0
 def testConstructor_009(self):
     """
     Test assignment of compressMode attribute, None value.
     """
     postgresql = PostgresqlConfig(compressMode="none")
     self.assertEqual("none", postgresql.compressMode)
     postgresql.compressMode = None
     self.assertEqual(None, postgresql.compressMode)
Exemplo n.º 3
0
 def testConstructor_017(self):
     """
     Test assignment of databases attribute, [] value.
     """
     postgresql = PostgresqlConfig()
     self.assertEqual(None, postgresql.databases)
     postgresql.databases = []
     self.assertEqual([], postgresql.databases)
Exemplo n.º 4
0
 def testConstructor_013(self):
     """
     Test assignment of all attribute, None value.
     """
     postgresql = PostgresqlConfig(all=True)
     self.assertEqual(True, postgresql.all)
     postgresql.all = None
     self.assertEqual(False, postgresql.all)
Exemplo n.º 5
0
 def testConstructor_007(self):
     """
     Test assignment of user attribute, valid value.
     """
     postgresql = PostgresqlConfig()
     self.assertEqual(None, postgresql.user)
     postgresql.user = "******"
     self.assertEqual("user", postgresql.user)
Exemplo n.º 6
0
 def testConstructor_014(self):
     """
     Test assignment of all attribute, valid value (real boolean).
     """
     postgresql = PostgresqlConfig()
     self.assertEqual(False, postgresql.all)
     postgresql.all = True
     self.assertEqual(True, postgresql.all)
     postgresql.all = False
     self.assertEqual(False, postgresql.all)
Exemplo n.º 7
0
 def testConstructor_018(self):
     """
     Test assignment of databases attribute, single valid entry.
     """
     postgresql = PostgresqlConfig()
     self.assertEqual(None, postgresql.databases)
     postgresql.databases = [
         "/whatever",
     ]
     self.assertEqual(["/whatever"], postgresql.databases)
     postgresql.databases.append("/stuff")
     self.assertEqual(["/whatever", "/stuff"], postgresql.databases)
Exemplo n.º 8
0
 def testConstructor_010(self):
     """
     Test assignment of compressMode attribute, valid value.
     """
     postgresql = PostgresqlConfig()
     self.assertEqual(None, postgresql.compressMode)
     postgresql.compressMode = "none"
     self.assertEqual("none", postgresql.compressMode)
     postgresql.compressMode = "gzip"
     self.assertEqual("gzip", postgresql.compressMode)
     postgresql.compressMode = "bzip2"
     self.assertEqual("bzip2", postgresql.compressMode)
Exemplo n.º 9
0
 def testComparison_009(self):
     """
     Test comparison of two differing objects, all differs (one None).
     """
     postgresql1 = PostgresqlConfig()
     postgresql2 = PostgresqlConfig(all=True)
     self.assertNotEqual(postgresql1, postgresql2)
     self.assertTrue(not postgresql1 == postgresql2)
     self.assertTrue(postgresql1 < postgresql2)
     self.assertTrue(postgresql1 <= postgresql2)
     self.assertTrue(not postgresql1 > postgresql2)
     self.assertTrue(not postgresql1 >= postgresql2)
     self.assertTrue(postgresql1 != postgresql2)
Exemplo n.º 10
0
 def testComparison_007(self):
     """
     Test comparison of two differing objects, compressMode differs (one None).
     """
     postgresql1 = PostgresqlConfig()
     postgresql2 = PostgresqlConfig(compressMode="gzip")
     self.assertNotEqual(postgresql1, postgresql2)
     self.assertTrue(not postgresql1 == postgresql2)
     self.assertTrue(postgresql1 < postgresql2)
     self.assertTrue(postgresql1 <= postgresql2)
     self.assertTrue(not postgresql1 > postgresql2)
     self.assertTrue(not postgresql1 >= postgresql2)
     self.assertTrue(postgresql1 != postgresql2)
Exemplo n.º 11
0
 def testComparison_004(self):
     """
     Test comparison of two identical objects, all attributes non-None, list non-empty.
     """
     postgresql1 = PostgresqlConfig("user", "none", True, ["whatever"])
     postgresql2 = PostgresqlConfig("user", "none", True, ["whatever"])
     self.assertEqual(postgresql1, postgresql2)
     self.assertTrue(postgresql1 == postgresql2)
     self.assertTrue(not postgresql1 < postgresql2)
     self.assertTrue(postgresql1 <= postgresql2)
     self.assertTrue(not postgresql1 > postgresql2)
     self.assertTrue(postgresql1 >= postgresql2)
     self.assertTrue(not postgresql1 != postgresql2)
Exemplo n.º 12
0
 def testComparison_002(self):
     """
     Test comparison of two identical objects, all attributes non-None, list None.
     """
     postgresql1 = PostgresqlConfig("user", "gzip", True, None)
     postgresql2 = PostgresqlConfig("user", "gzip", True, None)
     self.assertEqual(postgresql1, postgresql2)
     self.assertTrue(postgresql1 == postgresql2)
     self.assertTrue(not postgresql1 < postgresql2)
     self.assertTrue(postgresql1 <= postgresql2)
     self.assertTrue(not postgresql1 > postgresql2)
     self.assertTrue(postgresql1 >= postgresql2)
     self.assertTrue(not postgresql1 != postgresql2)
Exemplo n.º 13
0
 def testComparison_001(self):
     """
     Test comparison of two identical objects, all attributes None.
     """
     postgresql1 = PostgresqlConfig()
     postgresql2 = PostgresqlConfig()
     self.assertEqual(postgresql1, postgresql2)
     self.assertTrue(postgresql1 == postgresql2)
     self.assertTrue(not postgresql1 < postgresql2)
     self.assertTrue(postgresql1 <= postgresql2)
     self.assertTrue(not postgresql1 > postgresql2)
     self.assertTrue(postgresql1 >= postgresql2)
     self.assertTrue(not postgresql1 != postgresql2)
Exemplo n.º 14
0
 def testComparison_010(self):
     """
     Test comparison of two differing objects, all differs.
     """
     postgresql1 = PostgresqlConfig("user", "gzip", False, ["whatever"])
     postgresql2 = PostgresqlConfig("user", "gzip", True, ["whatever"])
     self.assertNotEqual(postgresql1, postgresql2)
     self.assertTrue(not postgresql1 == postgresql2)
     self.assertTrue(postgresql1 < postgresql2)
     self.assertTrue(postgresql1 <= postgresql2)
     self.assertTrue(not postgresql1 > postgresql2)
     self.assertTrue(not postgresql1 >= postgresql2)
     self.assertTrue(postgresql1 != postgresql2)
Exemplo n.º 15
0
 def testComparison_011(self):
     """
     Test comparison of two differing objects, databases differs (one None, one empty).
     """
     postgresql1 = PostgresqlConfig()
     postgresql2 = PostgresqlConfig(databases=[])
     self.assertNotEqual(postgresql1, postgresql2)
     self.assertTrue(not postgresql1 == postgresql2)
     self.assertTrue(postgresql1 < postgresql2)
     self.assertTrue(postgresql1 <= postgresql2)
     self.assertTrue(not postgresql1 > postgresql2)
     self.assertTrue(not postgresql1 >= postgresql2)
     self.assertTrue(postgresql1 != postgresql2)
Exemplo n.º 16
0
 def testComparison_013(self):
     """
     Test comparison of two differing objects, databases differs (one empty, one not empty).
     """
     postgresql1 = PostgresqlConfig("user", "gzip", True, [])
     postgresql2 = PostgresqlConfig("user", "gzip", True, ["whatever"])
     self.assertNotEqual(postgresql1, postgresql2)
     self.assertTrue(not postgresql1 == postgresql2)
     self.assertTrue(postgresql1 < postgresql2)
     self.assertTrue(postgresql1 <= postgresql2)
     self.assertTrue(not postgresql1 > postgresql2)
     self.assertTrue(not postgresql1 >= postgresql2)
     self.assertTrue(postgresql1 != postgresql2)
Exemplo n.º 17
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)
Exemplo n.º 18
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)
Exemplo n.º 19
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()
Exemplo n.º 20
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)
Exemplo n.º 21
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)
Exemplo n.º 22
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()
Exemplo n.º 23
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()
Exemplo n.º 24
0
 def testValidate_002(self):
     """
     Test validate on an empty postgresql section.
     """
     config = LocalConfig()
     config.postgresql = PostgresqlConfig()
     self.assertRaises(ValueError, config.validate)
Exemplo n.º 25
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)
Exemplo n.º 26
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()
Exemplo n.º 27
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)
Exemplo n.º 28
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)
Exemplo n.º 29
0
 def testConstructor_011(self):
     """
     Test assignment of compressMode attribute, invalid value (empty).
     """
     postgresql = PostgresqlConfig()
     self.assertEqual(None, postgresql.compressMode)
     self.failUnlessAssignRaises(ValueError, postgresql, "compressMode", "")
     self.assertEqual(None, postgresql.compressMode)
Exemplo n.º 30
0
 def testConstructor_020(self):
     """
     Test assignment of databases attribute, single invalid entry (empty).
     """
     postgresql = PostgresqlConfig()
     self.assertEqual(None, postgresql.databases)
     self.failUnlessAssignRaises(ValueError, postgresql, "databases", [""])
     self.assertEqual(None, postgresql.databases)