Exemplo n.º 1
0
 def testConstructor_005(self):
     """
     Test assignment of mysql attribute, valid value.
     """
     config = LocalConfig()
     config.mysql = MysqlConfig()
     self.assertEqual(MysqlConfig(), config.mysql)
Exemplo n.º 2
0
 def testConstructor_010(self):
     """
     Test assignment of password attribute, valid value.
     """
     mysql = MysqlConfig()
     self.assertEqual(None, mysql.password)
     mysql.password = "******"
     self.assertEqual("password", mysql.password)
Exemplo n.º 3
0
 def testConstructor_016(self):
     """
     Test assignment of all attribute, None value.
     """
     mysql = MysqlConfig(all=True)
     self.assertEqual(True, mysql.all)
     mysql.all = None
     self.assertEqual(False, mysql.all)
Exemplo n.º 4
0
 def testConstructor_012(self):
     """
     Test assignment of compressMode attribute, None value.
     """
     mysql = MysqlConfig(compressMode="none")
     self.assertEqual("none", mysql.compressMode)
     mysql.compressMode = None
     self.assertEqual(None, mysql.compressMode)
Exemplo n.º 5
0
 def testConstructor_009(self):
     """
     Test assignment of password attribute, None value.
     """
     mysql = MysqlConfig(password="******")
     self.assertEqual("password", mysql.password)
     mysql.password = None
     self.assertEqual(None, mysql.password)
Exemplo n.º 6
0
 def testConstructor_007(self):
     """
     Test assignment of user attribute, valid value.
     """
     mysql = MysqlConfig()
     self.assertEqual(None, mysql.user)
     mysql.user = "******"
     self.assertEqual("user", mysql.user)
Exemplo n.º 7
0
 def testConstructor_006(self):
     """
     Test assignment of user attribute, None value.
     """
     mysql = MysqlConfig(user="******")
     self.assertEqual("user", mysql.user)
     mysql.user = None
     self.assertEqual(None, mysql.user)
Exemplo n.º 8
0
 def testConstructor_020(self):
     """
     Test assignment of databases attribute, [] value.
     """
     mysql = MysqlConfig()
     self.assertEqual(None, mysql.databases)
     mysql.databases = []
     self.assertEqual([], mysql.databases)
Exemplo n.º 9
0
 def testConstructor_017(self):
     """
     Test assignment of all attribute, valid value (real boolean).
     """
     mysql = MysqlConfig()
     self.assertEqual(False, mysql.all)
     mysql.all = True
     self.assertEqual(True, mysql.all)
     mysql.all = False
     self.assertEqual(False, mysql.all)
Exemplo n.º 10
0
 def testConstructor_021(self):
     """
     Test assignment of databases attribute, single valid entry.
     """
     mysql = MysqlConfig()
     self.assertEqual(None, mysql.databases)
     mysql.databases = [
         "/whatever",
     ]
     self.assertEqual(["/whatever"], mysql.databases)
     mysql.databases.append("/stuff")
     self.assertEqual(["/whatever", "/stuff"], mysql.databases)
Exemplo n.º 11
0
 def testConstructor_013(self):
     """
     Test assignment of compressMode attribute, valid value.
     """
     mysql = MysqlConfig()
     self.assertEqual(None, mysql.compressMode)
     mysql.compressMode = "none"
     self.assertEqual("none", mysql.compressMode)
     mysql.compressMode = "gzip"
     self.assertEqual("gzip", mysql.compressMode)
     mysql.compressMode = "bzip2"
     self.assertEqual("bzip2", mysql.compressMode)
Exemplo n.º 12
0
 def testComparison_002(self):
     """
     Test comparison of two identical objects, all attributes non-None, list None.
     """
     mysql1 = MysqlConfig("user", "password", "gzip", True, None)
     mysql2 = MysqlConfig("user", "password", "gzip", True, None)
     self.assertEqual(mysql1, mysql2)
     self.assertTrue(mysql1 == mysql2)
     self.assertTrue(not mysql1 < mysql2)
     self.assertTrue(mysql1 <= mysql2)
     self.assertTrue(not mysql1 > mysql2)
     self.assertTrue(mysql1 >= mysql2)
     self.assertTrue(not mysql1 != mysql2)
Exemplo n.º 13
0
 def testComparison_001(self):
     """
     Test comparison of two identical objects, all attributes None.
     """
     mysql1 = MysqlConfig()
     mysql2 = MysqlConfig()
     self.assertEqual(mysql1, mysql2)
     self.assertTrue(mysql1 == mysql2)
     self.assertTrue(not mysql1 < mysql2)
     self.assertTrue(mysql1 <= mysql2)
     self.assertTrue(not mysql1 > mysql2)
     self.assertTrue(mysql1 >= mysql2)
     self.assertTrue(not mysql1 != mysql2)
Exemplo n.º 14
0
 def testComparison_004(self):
     """
     Test comparison of two identical objects, all attributes non-None, list non-empty.
     """
     mysql1 = MysqlConfig("user", "password", "none", True, ["whatever"])
     mysql2 = MysqlConfig("user", "password", "none", True, ["whatever"])
     self.assertEqual(mysql1, mysql2)
     self.assertTrue(mysql1 == mysql2)
     self.assertTrue(not mysql1 < mysql2)
     self.assertTrue(mysql1 <= mysql2)
     self.assertTrue(not mysql1 > mysql2)
     self.assertTrue(mysql1 >= mysql2)
     self.assertTrue(not mysql1 != mysql2)
Exemplo n.º 15
0
 def testComparison_015(self):
     """
     Test comparison of two differing objects, databases differs (one empty, one not empty).
     """
     mysql1 = MysqlConfig("user", "password", "gzip", True, [])
     mysql2 = MysqlConfig("user", "password", "gzip", True, ["whatever"])
     self.assertNotEqual(mysql1, mysql2)
     self.assertTrue(not mysql1 == mysql2)
     self.assertTrue(mysql1 < mysql2)
     self.assertTrue(mysql1 <= mysql2)
     self.assertTrue(not mysql1 > mysql2)
     self.assertTrue(not mysql1 >= mysql2)
     self.assertTrue(mysql1 != mysql2)
Exemplo n.º 16
0
 def testComparison_007(self):
     """
     Test comparison of two differing objects, password differs (one None).
     """
     mysql1 = MysqlConfig()
     mysql2 = MysqlConfig(password="******")
     self.assertNotEqual(mysql1, mysql2)
     self.assertTrue(not mysql1 == mysql2)
     self.assertTrue(mysql1 < mysql2)
     self.assertTrue(mysql1 <= mysql2)
     self.assertTrue(not mysql1 > mysql2)
     self.assertTrue(not mysql1 >= mysql2)
     self.assertTrue(mysql1 != mysql2)
Exemplo n.º 17
0
 def testComparison_014(self):
     """
     Test comparison of two differing objects, databases differs (one None, one not empty).
     """
     mysql1 = MysqlConfig()
     mysql2 = MysqlConfig(databases=["whatever"])
     self.assertNotEqual(mysql1, mysql2)
     self.assertTrue(not mysql1 == mysql2)
     self.assertTrue(mysql1 < mysql2)
     self.assertTrue(mysql1 <= mysql2)
     self.assertTrue(not mysql1 > mysql2)
     self.assertTrue(not mysql1 >= mysql2)
     self.assertTrue(mysql1 != mysql2)
Exemplo n.º 18
0
 def testComparison_012(self):
     """
     Test comparison of two differing objects, all differs.
     """
     mysql1 = MysqlConfig("user", "password", "gzip", False, ["whatever"])
     mysql2 = MysqlConfig("user", "password", "gzip", True, ["whatever"])
     self.assertNotEqual(mysql1, mysql2)
     self.assertTrue(not mysql1 == mysql2)
     self.assertTrue(mysql1 < mysql2)
     self.assertTrue(mysql1 <= mysql2)
     self.assertTrue(not mysql1 > mysql2)
     self.assertTrue(not mysql1 >= mysql2)
     self.assertTrue(mysql1 != mysql2)
Exemplo n.º 19
0
 def testComparison_011(self):
     """
     Test comparison of two differing objects, all differs (one None).
     """
     mysql1 = MysqlConfig()
     mysql2 = MysqlConfig(all=True)
     self.assertNotEqual(mysql1, mysql2)
     self.assertTrue(not mysql1 == mysql2)
     self.assertTrue(mysql1 < mysql2)
     self.assertTrue(mysql1 <= mysql2)
     self.assertTrue(not mysql1 > mysql2)
     self.assertTrue(not mysql1 >= mysql2)
     self.assertTrue(mysql1 != mysql2)
Exemplo n.º 20
0
 def testComparison_009(self):
     """
     Test comparison of two differing objects, compressMode differs (one None).
     """
     mysql1 = MysqlConfig()
     mysql2 = MysqlConfig(compressMode="gzip")
     self.assertNotEqual(mysql1, mysql2)
     self.assertTrue(not mysql1 == mysql2)
     self.assertTrue(mysql1 < mysql2)
     self.assertTrue(mysql1 <= mysql2)
     self.assertTrue(not mysql1 > mysql2)
     self.assertTrue(not mysql1 >= mysql2)
     self.assertTrue(mysql1 != mysql2)
Exemplo n.º 21
0
 def testAddConfig_004(self):
     """
     Test with no databases, all other values filled in, all=False.
     """
     config = LocalConfig()
     config.mysql = MysqlConfig("user", "password", "gzip", False, None)
     self.validateAddConfig(config)
Exemplo n.º 22
0
 def testValidate_011(self):
     """
     Test validate on a non-empty mysql section, with user=None and password=None.
     """
     config = LocalConfig()
     config.mysql = MysqlConfig(None, None, "gzip", True, None)
     config.validate()
Exemplo n.º 23
0
 def testAddConfig_003(self):
     """
     Test with no databases, all other values filled in, all=True.
     """
     config = LocalConfig()
     config.mysql = MysqlConfig("user", "password", "none", True, None)
     self.validateAddConfig(config)
Exemplo n.º 24
0
 def testValidate_007(self):
     """
     Test validate on a non-empty mysql section, all=False, empty databases.
     """
     config = LocalConfig()
     config.mysql = MysqlConfig("user", "password", "bzip2", False, [])
     self.assertRaises(ValueError, config.validate)
Exemplo n.º 25
0
 def testValidate_006(self):
     """
     Test validate on a non-empty mysql section, all=False, databases=None.
     """
     config = LocalConfig()
     config.mysql = MysqlConfig("user", "password", "gzip", False, None)
     self.assertRaises(ValueError, config.validate)
Exemplo n.º 26
0
 def testValidate_004(self):
     """
     Test validate on a non-empty mysql section, all=True, empty databases.
     """
     config = LocalConfig()
     config.mysql = MysqlConfig("user", "password", "none", True, [])
     config.validate()
Exemplo n.º 27
0
 def testValidate_003(self):
     """
     Test validate on a non-empty mysql section, all=True, databases=None.
     """
     config = LocalConfig()
     config.mysql = MysqlConfig("user", "password", "gzip", True, None)
     config.validate()
Exemplo n.º 28
0
 def testValidate_002(self):
     """
     Test validate on an empty mysql section.
     """
     config = LocalConfig()
     config.mysql = MysqlConfig()
     self.assertRaises(ValueError, config.validate)
Exemplo n.º 29
0
 def testValidate_008(self):
     """
     Test validate on a non-empty mysql section, all=False, non-empty databases.
     """
     config = LocalConfig()
     config.mysql = MysqlConfig("user", "password", "gzip", False,
                                ["whatever"])
     config.validate()
Exemplo n.º 30
0
    def testComparison_004(self):
        """
        Test comparison of two differing objects, mysql differs.
        """
        config1 = LocalConfig()
        config1.mysql = MysqlConfig(user="******")

        config2 = LocalConfig()
        config2.mysql = MysqlConfig(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)