def testConstructor_005(self): """ Test assignment of mysql attribute, valid value. """ config = LocalConfig() config.mysql = MysqlConfig() self.assertEqual(MysqlConfig(), config.mysql)
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)
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)
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)
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)
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)
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)
def testConstructor_020(self): """ Test assignment of databases attribute, [] value. """ mysql = MysqlConfig() self.assertEqual(None, mysql.databases) mysql.databases = [] self.assertEqual([], mysql.databases)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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()
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)
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)
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)
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()
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()
def testValidate_002(self): """ Test validate on an empty mysql section. """ config = LocalConfig() config.mysql = MysqlConfig() self.assertRaises(ValueError, config.validate)
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()
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)