Beispiel #1
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')
Beispiel #2
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")
Beispiel #3
0
def test_check_loglevel_quiet(mock_loglevels):
    """
    Tests the return of providing a loglevel of 'quiet'
    """
    with patch.dict(LOG_LEVELS, mock_loglevels):
        assert cmdmod._check_loglevel(level="quiet") is None
Beispiel #4
0
def test_check_loglevel_bad_level_not_str(mock_loglevels):
    """
    Tests the return of providing an invalid loglevel option that is not a string
    """
    with patch.dict(LOG_LEVELS, mock_loglevels):
        assert cmdmod._check_loglevel(level=1000) == "foo"
Beispiel #5
0
def test_check_loglevel_bad_level(mock_loglevels):
    """
    Tests return of providing an invalid loglevel option
    """
    with patch.dict(LOG_LEVELS, mock_loglevels):
        assert cmdmod._check_loglevel(level="bad_loglevel") == "foo"
Beispiel #6
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)
Beispiel #7
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')
Beispiel #8
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)
Beispiel #9
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)
Beispiel #10
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)
Beispiel #11
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')
Beispiel #12
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')
 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")