Ejemplo n.º 1
0
    def test_appends_first_line_message(self, mock_get_message):
        mock_get_message.return_value = '<line_message>'
        line = get_first_line(self.status, sentinel.message)

        self.assertIn('<line_message>', line)
        mock_get_message.assert_called_once_with(self.status, sentinel.message)
Ejemplo n.º 2
0
 def test_shows_crit_status(self):
     self.mock_exit_code.return_value = LoggerStatus.EXIT_CRIT
     line = get_first_line(self.status)
     self.assertTrue(line.startswith('STATUS: CRITICAL.'))
Ejemplo n.º 3
0
 def test_shows_unk_status(self):
     self.mock_exit_code.return_value = LoggerStatus.EXIT_UNK
     line = get_first_line(self.status)
     self.assertTrue(line.startswith('STATUS: UNKNOWN.'))
Ejemplo n.º 4
0
 def test_shows_ok_status(self):
     line = get_first_line(self.status)
     self.assertTrue(line.startswith('STATUS: OK.'))
Ejemplo n.º 5
0
 def test_shows_warn_status(self):
     self.mock_exit_code.return_value = LoggerStatus.EXIT_WARN
     line = get_first_line(self.status)
     self.assertTrue(line.startswith('STATUS: WARNING.'))
Ejemplo n.º 6
0
    def test_appends_first_line_message(self, mock_get_message):
        mock_get_message.return_value = '<line_message>'
        line = get_first_line(self.status, sentinel.message)

        self.assertIn('<line_message>', line)
        mock_get_message.assert_called_once_with(self.status, sentinel.message)
Ejemplo n.º 7
0
 def test_shows_unk_status(self):
     self.mock_exit_code.return_value = LoggerStatus.EXIT_UNK
     line = get_first_line(self.status)
     self.assertTrue(line.startswith('STATUS: UNKNOWN.'))
Ejemplo n.º 8
0
 def test_shows_crit_status(self):
     self.mock_exit_code.return_value = LoggerStatus.EXIT_CRIT
     line = get_first_line(self.status)
     self.assertTrue(line.startswith('STATUS: CRITICAL.'))
Ejemplo n.º 9
0
 def test_shows_warn_status(self):
     self.mock_exit_code.return_value = LoggerStatus.EXIT_WARN
     line = get_first_line(self.status)
     self.assertTrue(line.startswith('STATUS: WARNING.'))
Ejemplo n.º 10
0
 def test_shows_ok_status(self):
     line = get_first_line(self.status)
     self.assertTrue(line.startswith('STATUS: OK.'))