Esempio n. 1
0
class TestUmitConf(unittest.TestCase):
    def setUp(self):
        self.umit_conf = UmitConf()

    def tearDown(self):
        del self.umit_conf

    def testGetColoredDiff(self):
        self.umit_conf.colored_diff

    def testSetColoredDiff(self):
        self.umit_conf.colored_diff = True

    def testColoredDiffSaved(self):
        self.umit_conf.colored_diff = False
        self.umit_conf.save_changes()

        colored = self.umit_conf.colored_diff
        self.assert_(colored == False,
                "Failed to save colored diff - False. Returned %s" % colored)

        self.umit_conf.colored_diff = True
        self.umit_conf.save_changes()

        colored = self.umit_conf.colored_diff
        self.assert_(colored == True,
                "Failed to save colored diff - True. Returned %s" % colored)

    def testGetDiffMode(self):
        self.umit_conf.diff_mode

    def testSetDiffMode(self):
        self.umit_conf.diff_mode = "compare"

    def testDiffModeSaved(self):
        self.umit_conf.diff_mode = "text"
        self.umit_conf.save_changes()

        mode = self.umit_conf.diff_mode
        self.assert_(mode == "text",
                 "Failed to save diff_mode 'text'. Returned '%s'" % mode)

        self.umit_conf.diff_mode = "compare"
        self.umit_conf.save_changes()

        mode = self.umit_conf.diff_mode
        self.assert_(mode == "compare",
                 "Failed to save diff_mode 'compare'. Returned '%s'" % mode)
Esempio n. 2
0
 def setUp(self):
     self.umit_conf = UmitConf()