Esempio n. 1
0
 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
Esempio n. 2
0
    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]))
Esempio n. 3
0
    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, []))
Esempio n. 4
0
 def testHelp(self):
     c = command.Repair()
     self.failIfEqual(None, c.Help())
Esempio n. 5
0
 def testCreate(self):
     c = command.Repair()
     self.assertTrue(isinstance(c, command.Repair))
Esempio n. 6
0
 def testHelp(self):
     c = command.Repair()
     self.assertNotEqual(None, c.Help())