Ejemplo n.º 1
0
 def testMooseMessageColor(self):
     """
     Test that the color flag is working.
     """
     message.mooseMessage("This should be RED.", color = 'RED')
     output = sys.stdout.getvalue()
     self.assertIn('\033[31m', output)
Ejemplo n.º 2
0
 def testMooseMessageColor(self):
     """
     Test that the color flag is working.
     """
     message.mooseMessage("This should be RED.", color = 'RED')
     output = sys.stdout.getvalue()
     self.assertIn('\033[31m', output)
Ejemplo n.º 3
0
 def testMooseMessageDefault(self):
     """
     Test the default message with a string and a number supplied.
     """
     message.mooseMessage("The default message with a number", 1.0)
     output = sys.stdout.getvalue()
     self.assertIn("The default message with a number 1.0", output)
Ejemplo n.º 4
0
 def testMooseMessageDefault(self):
     """
     Test the default message with a string and a number supplied.
     """
     message.mooseMessage("The default message with a number", 1.0)
     output = sys.stdout.getvalue()
     self.assertIn("The default message with a number 1.0", output)
Ejemplo n.º 5
0
 def testMooseMessageDebugOn(self):
     """
     Test that the debug flag enables debug messages.
     """
     message.MOOSE_DEBUG_MODE = True
     message.mooseMessage("You should see this!", debug=True)
     output = sys.stdout.getvalue()
     self.assertIn("You should see this!", output)
Ejemplo n.º 6
0
 def testMooseMessageDebugOn(self):
     """
     Test that the debug flag enables debug messages.
     """
     message.MOOSE_DEBUG_MODE = True
     message.mooseMessage("You should see this!", debug=True)
     output = sys.stdout.getvalue()
     self.assertIn("You should see this!", output)
Ejemplo n.º 7
0
 def testMooseMessageTraceback(self):
     """
     Test that the traceback argument is operational.
     """
     message.mooseMessage("A message", "with a traceback!", traceback = True)
     output = sys.stdout.getvalue()
     err = sys.stderr.getvalue()
     self.assertIn("A message with a traceback!", output)
     self.assertIn("message.mooseMessage", err)
Ejemplo n.º 8
0
 def testMooseMessageTraceback(self):
     """
     Test that the traceback argument is operational.
     """
     message.mooseMessage("A message", "with a traceback!", traceback = True)
     output = sys.stdout.getvalue()
     err = sys.stderr.getvalue()
     self.assertIn("A message with a traceback!", output)
     self.assertIn("message.mooseMessage", err)
    def testWindows(self):
        w = self.newWidget()
        self.assertEqual(w.log.isVisible(), False)
        w._showLog()
        self.assertEqual(w.log.isVisible(), True)
        message.mooseMessage("Foobar")
        self.assertIn("Foobar", w.log.log.toPlainText())
        w._showLog()
        self.assertEqual(w.log.isVisible(), False)

        self.assertEqual(w.settings.isVisible(), False)
        w._showPreferences()
        self.assertEqual(w.settings.isVisible(), True)
Ejemplo n.º 10
0
    def testWindows(self):
        w = self.newWidget()
        self.assertEqual(w.log.isVisible(), False)
        w._showLog()
        self.assertEqual(w.log.isVisible(), True)
        message.mooseMessage("Foobar")
        self.assertIn("Foobar", w.log.log.toPlainText())
        w._showLog()
        self.assertEqual(w.log.isVisible(), False)

        self.assertEqual(w.settings.isVisible(), False)
        w._showPreferences()
        self.assertEqual(w.settings.isVisible(), True)