def testComparison_016(self): """ Test comparison of two differing objects, databases differs (both not empty). """ mysql1 = MysqlConfig("user", "password", "gzip", True, [ "whatever", ]) mysql2 = MysqlConfig("user", "password", "gzip", True, [ "whatever", "bogus", ]) self.failIfEqual(mysql1, mysql2) self.failUnless(not mysql1 == mysql2) self.failUnless( not mysql1 < mysql2) # note: different than standard due to unsorted list self.failUnless( not mysql1 <= mysql2) # note: different than standard due to unsorted list self.failUnless( mysql1 > mysql2) # note: different than standard due to unsorted list self.failUnless( mysql1 >= mysql2) # note: different than standard due to unsorted list self.failUnless(mysql1 != mysql2)
def testConstructor_005(self): """ Test assignment of mysql attribute, valid value. """ config = LocalConfig() config.mysql = MysqlConfig() self.failUnlessEqual(MysqlConfig(), config.mysql)
def testConstructor_016(self): """ Test assignment of all attribute, None value. """ mysql = MysqlConfig(all=True) self.failUnlessEqual(True, mysql.all) mysql.all = None self.failUnlessEqual(False, mysql.all)
def testConstructor_012(self): """ Test assignment of compressMode attribute, None value. """ mysql = MysqlConfig(compressMode="none") self.failUnlessEqual("none", mysql.compressMode) mysql.compressMode = None self.failUnlessEqual(None, mysql.compressMode)
def testConstructor_010(self): """ Test assignment of password attribute, valid value. """ mysql = MysqlConfig() self.failUnlessEqual(None, mysql.password) mysql.password = "******" self.failUnlessEqual("password", mysql.password)
def testConstructor_009(self): """ Test assignment of password attribute, None value. """ mysql = MysqlConfig(password="******") self.failUnlessEqual("password", mysql.password) mysql.password = None self.failUnlessEqual(None, mysql.password)
def testConstructor_007(self): """ Test assignment of user attribute, valid value. """ mysql = MysqlConfig() self.failUnlessEqual(None, mysql.user) mysql.user = "******" self.failUnlessEqual("user", mysql.user)
def testConstructor_020(self): """ Test assignment of databases attribute, [] value. """ mysql = MysqlConfig() self.failUnlessEqual(None, mysql.databases) mysql.databases = [] self.failUnlessEqual([], mysql.databases)
def testConstructor_017(self): """ Test assignment of all attribute, valid value (real boolean). """ mysql = MysqlConfig() self.failUnlessEqual(False, mysql.all) mysql.all = True self.failUnlessEqual(True, mysql.all) mysql.all = False self.failUnlessEqual(False, mysql.all)
def testConstructor_013(self): """ Test assignment of compressMode attribute, valid value. """ mysql = MysqlConfig() self.failUnlessEqual(None, mysql.compressMode) mysql.compressMode = "none" self.failUnlessEqual("none", mysql.compressMode) mysql.compressMode = "gzip" self.failUnlessEqual("gzip", mysql.compressMode) mysql.compressMode = "bzip2" self.failUnlessEqual("bzip2", mysql.compressMode)
def testComparison_005(self): """ Test comparison of two differing objects, user differs (one None). """ mysql1 = MysqlConfig() mysql2 = MysqlConfig(user="******") self.failIfEqual(mysql1, mysql2) self.failUnless(not mysql1 == mysql2) self.failUnless(mysql1 < mysql2) self.failUnless(mysql1 <= mysql2) self.failUnless(not mysql1 > mysql2) self.failUnless(not mysql1 >= mysql2) self.failUnless(mysql1 != mysql2)
def testComparison_003(self): """ Test comparison of two identical objects, all attributes non-None, list empty. """ mysql1 = MysqlConfig("user", "password", "bzip2", True, []) mysql2 = MysqlConfig("user", "password", "bzip2", True, []) self.failUnlessEqual(mysql1, mysql2) self.failUnless(mysql1 == mysql2) self.failUnless(not mysql1 < mysql2) self.failUnless(mysql1 <= mysql2) self.failUnless(not mysql1 > mysql2) self.failUnless(mysql1 >= mysql2) self.failUnless(not mysql1 != mysql2)
def testComparison_001(self): """ Test comparison of two identical objects, all attributes None. """ mysql1 = MysqlConfig() mysql2 = MysqlConfig() self.failUnlessEqual(mysql1, mysql2) self.failUnless(mysql1 == mysql2) self.failUnless(not mysql1 < mysql2) self.failUnless(mysql1 <= mysql2) self.failUnless(not mysql1 > mysql2) self.failUnless(mysql1 >= mysql2) self.failUnless(not mysql1 != mysql2)
def testComparison_007(self): """ Test comparison of two differing objects, password differs (one None). """ mysql1 = MysqlConfig() mysql2 = MysqlConfig(password="******") self.failIfEqual(mysql1, mysql2) self.failUnless(not mysql1 == mysql2) self.failUnless(mysql1 < mysql2) self.failUnless(mysql1 <= mysql2) self.failUnless(not mysql1 > mysql2) self.failUnless(not mysql1 >= mysql2) self.failUnless(mysql1 != mysql2)
def testComparison_013(self): """ Test comparison of two differing objects, databases differs (one None, one empty). """ mysql1 = MysqlConfig() mysql2 = MysqlConfig(databases=[]) self.failIfEqual(mysql1, mysql2) self.failUnless(not mysql1 == mysql2) self.failUnless(mysql1 < mysql2) self.failUnless(mysql1 <= mysql2) self.failUnless(not mysql1 > mysql2) self.failUnless(not mysql1 >= mysql2) self.failUnless(mysql1 != mysql2)
def testComparison_009(self): """ Test comparison of two differing objects, compressMode differs (one None). """ mysql1 = MysqlConfig() mysql2 = MysqlConfig(compressMode="gzip") self.failIfEqual(mysql1, mysql2) self.failUnless(not mysql1 == mysql2) self.failUnless(mysql1 < mysql2) self.failUnless(mysql1 <= mysql2) self.failUnless(not mysql1 > mysql2) self.failUnless(not mysql1 >= mysql2) self.failUnless(mysql1 != mysql2)
def testComparison_011(self): """ Test comparison of two differing objects, all differs (one None). """ mysql1 = MysqlConfig() mysql2 = MysqlConfig(all=True) self.failIfEqual(mysql1, mysql2) self.failUnless(not mysql1 == mysql2) self.failUnless(mysql1 < mysql2) self.failUnless(mysql1 <= mysql2) self.failUnless(not mysql1 > mysql2) self.failUnless(not mysql1 >= mysql2) self.failUnless(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.failIfEqual(mysql1, mysql2) self.failUnless(not mysql1 == mysql2) self.failUnless(mysql1 < mysql2) self.failUnless(mysql1 <= mysql2) self.failUnless(not mysql1 > mysql2) self.failUnless(not mysql1 >= mysql2) self.failUnless(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_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.failUnlessRaises(ValueError, config.validate)
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.failUnlessRaises(ValueError, 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_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_002(self): """ Test validate on an empty mysql section. """ config = LocalConfig() config.mysql = MysqlConfig() self.failUnlessRaises(ValueError, 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.failIfEqual(config1, config2) self.failUnless(not config1 == config2) self.failUnless(config1 < config2) self.failUnless(config1 <= config2) self.failUnless(not config1 > config2) self.failUnless(not config1 >= config2) self.failUnless(config1 != config2)
def testComparison_002(self): """ Test comparison of two identical objects, all attributes non-None. """ config1 = LocalConfig() config1.mysql = MysqlConfig() config2 = LocalConfig() config2.mysql = MysqlConfig() self.failUnlessEqual(config1, config2) self.failUnless(config1 == config2) self.failUnless(not config1 < config2) self.failUnless(config1 <= config2) self.failUnless(not config1 > config2) self.failUnless(config1 >= config2) self.failUnless(not config1 != config2)
def testConstructor_021(self): """ Test assignment of databases attribute, single valid entry. """ mysql = MysqlConfig() self.failUnlessEqual(None, mysql.databases) mysql.databases = [ "/whatever", ] self.failUnlessEqual([ "/whatever", ], mysql.databases) mysql.databases.append("/stuff") self.failUnlessEqual([ "/whatever", "/stuff", ], mysql.databases)
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.failIfEqual(mysql1, mysql2) self.failUnless(not mysql1 == mysql2) self.failUnless(mysql1 < mysql2) self.failUnless(mysql1 <= mysql2) self.failUnless(not mysql1 > mysql2) self.failUnless(not mysql1 >= mysql2) self.failUnless(mysql1 != mysql2)