def testRunWithBadParameters(self): c = command.Repair() # Trap stderr so the unit test runs clean, # since unit test status is printed on stderr. dev_null = StringIO.StringIO() stderr = sys.stderr sys.stderr = dev_null self.assertEquals(2, c.Run(None, ['--invalid'])) sys.stderr = stderr
def testRunWithParameters(self): def FakeVerifyConfiguration(conf): """Assert that we call VerifyConfiguration correctly.""" self.assertEquals(conf, self.conf) return (0, 1) config.VerifyConfiguration = FakeVerifyConfiguration c = command.Repair() self.assertEquals(1, c.Run(self.conf, ['-m', config.MAP_PASSWORD]))
def testRunWithNoParameters(self): c = command.Repair() def FakeVerifyConfiguration(conf): """Assert that we call VerifyConfiguration correctly.""" self.assertEquals(conf, self.conf) return (0, 1) config.VerifyConfiguration = FakeVerifyConfiguration self.conf.maps = [] self.assertEquals(1, c.Run(self.conf, []))
def testHelp(self): c = command.Repair() self.failIfEqual(None, c.Help())
def testCreate(self): c = command.Repair() self.assertTrue(isinstance(c, command.Repair))
def testHelp(self): c = command.Repair() self.assertNotEqual(None, c.Help())