Exemple #1
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()
Exemple #2
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)
Exemple #3
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.failUnlessRaises(ValueError, config.validate)
Exemple #4
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.failUnlessRaises(ValueError, config.validate)
Exemple #5
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()
Exemple #6
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()
Exemple #7
0
 def testValidate_001(self):
     """
   Test validate on a None mysql section.
   """
     config = LocalConfig()
     config.mysql = None
     self.failUnlessRaises(ValueError, config.validate)
Exemple #8
0
 def testValidate_002(self):
     """
   Test validate on an empty mysql section.
   """
     config = LocalConfig()
     config.mysql = MysqlConfig()
     self.failUnlessRaises(ValueError, config.validate)
Exemple #9
0
 def testConstructor_005(self):
     """
   Test assignment of mysql attribute, valid value.
   """
     config = LocalConfig()
     config.mysql = MysqlConfig()
     self.failUnlessEqual(MysqlConfig(), config.mysql)
Exemple #10
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)
Exemple #11
0
 def testConstructor_004(self):
     """
   Test assignment of mysql attribute, None value.
   """
     config = LocalConfig()
     config.mysql = None
     self.failUnlessEqual(None, config.mysql)
Exemple #12
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.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)
Exemple #13
0
    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)
Exemple #14
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()
Exemple #15
0
 def testAddConfig_006(self):
     """
   Test with single database, all other values filled in, all=False.
   """
     config = LocalConfig()
     config.mysql = MysqlConfig("user", "password", "none", False, [
         "database",
     ])
     self.validateAddConfig(config)
Exemple #16
0
 def testAddConfig_011(self):
     """
   Test with multiple databases, user=None and password=None but all other values filled in, all=False.
   """
     config = LocalConfig()
     config.mysql = MysqlConfig(None, None, "gzip", True, [
         "database1",
         "database2",
     ])
     self.validateAddConfig(config)
Exemple #17
0
 def testAddConfig_008(self):
     """
   Test with multiple databases, all other values filled in, all=False.
   """
     config = LocalConfig()
     config.mysql = MysqlConfig("user", "password", "gzip", True, [
         "database1",
         "database2",
     ])
     self.validateAddConfig(config)