Example #1
0
 def test_check_loglevel_utils_quite(self):
     '''
     Tests the return of quiet=True
     '''
     with patch.dict(LOG_LEVELS, self.mock_loglevels):
         self.assertEqual(cmdmod._check_loglevel(quiet=True), None)
Example #2
0
 def test_check_loglevel_quiet(self):
     '''
     Tests the return of providing a loglevel of 'quiet'
     '''
     with patch.dict(LOG_LEVELS, self.mock_loglevels):
         self.assertEqual(cmdmod._check_loglevel(level='quiet'), None)
Example #3
0
 def test_check_loglevel_bad_level(self):
     '''
     Tests return of providing an invalid loglevel option
     '''
     with patch.dict(LOG_LEVELS, self.mock_loglevels):
         self.assertEqual(cmdmod._check_loglevel(level='bad_loglevel'), 'foo')
Example #4
0
 def test_check_loglevel_bad_level_not_str(self):
     '''
     Tests the return of providing an invalid loglevel option that is not a string
     '''
     with patch.dict(LOG_LEVELS, self.mock_loglevels):
         self.assertEqual(cmdmod._check_loglevel(level=1000), 'foo')
 def test_check_loglevel_bad_level(self):
     """
     Tests return of providing an invalid loglevel option
     """
     with patch.dict(LOG_LEVELS, self.mock_loglevels):
         self.assertEqual(cmdmod._check_loglevel(level="bad_loglevel"), "foo")