예제 #1
0
 def test_is_valid_shell_unavailable(self):
     """
     Tests return when provided shell is not available
     """
     with patch("os.path.exists", MagicMock(return_value=True)):
         with patch("salt.utils.files.fopen",
                    mock_open(read_data=MOCK_SHELL_FILE)):
             self.assertFalse(cmdmod._is_valid_shell("foo"))
예제 #2
0
def test_is_valid_shell_available():
    """
    Tests return when provided shell is available
    """
    with patch("os.path.exists", MagicMock(return_value=True)):
        with patch("salt.utils.files.fopen",
                   mock_open(read_data=MOCK_SHELL_FILE)):
            assert cmdmod._is_valid_shell("/bin/bash")
예제 #3
0
 def test_is_valid_shell_none(self):
     '''
     Tests return of when os.path.exists(/etc/shells) isn't available
     '''
     with patch('os.path.exists', MagicMock(return_value=False)):
         self.assertIsNone(cmdmod._is_valid_shell('foo'))
예제 #4
0
 def test_is_valid_shell_windows(self):
     '''
     Tests return if running on windows
     '''
     with patch('salt.utils.platform.is_windows', MagicMock(return_value=True)):
         self.assertTrue(cmdmod._is_valid_shell('foo'))
예제 #5
0
 def test_is_valid_shell_unavailable(self):
     '''
     Tests return when provided shell is not available
     '''
     with patch('salt.utils.fopen', mock_open(read_data=MOCK_SHELL_FILE)):
         self.assertFalse(cmdmod._is_valid_shell('foo'))
예제 #6
0
 def test_is_valid_shell_available(self):
     '''
     Tests return when provided shell is available
     '''
     with patch('salt.utils.fopen', mock_open(read_data=MOCK_SHELL_FILE)):
         self.assertTrue(cmdmod._is_valid_shell('/bin/bash'))
예제 #7
0
 def test_is_valid_shell_none(self):
     '''
     Tests return of when os.path.exists(/etc/shells) isn't available
     '''
     self.assertIsNone(cmdmod._is_valid_shell('foo'))
예제 #8
0
 def test_is_valid_shell_windows(self):
     '''
     Tests return if running on windows
     '''
     self.assertTrue(cmdmod._is_valid_shell('foo'))
예제 #9
0
파일: cmdmod_test.py 프로젝트: bryson/salt
 def test_is_valid_shell_available(self):
     '''
     Tests return when provided shell is available
     '''
     with patch('salt.utils.fopen', mock_open(read_data=MOCK_SHELL_FILE)):
         self.assertTrue(cmdmod._is_valid_shell('/bin/bash'))
예제 #10
0
파일: cmdmod_test.py 프로젝트: bryson/salt
 def test_is_valid_shell_none(self):
     '''
     Tests return of when os.path.exists(/etc/shells) isn't available
     '''
     self.assertIsNone(cmdmod._is_valid_shell('foo'))
예제 #11
0
파일: cmdmod_test.py 프로젝트: bryson/salt
 def test_is_valid_shell_windows(self):
     '''
     Tests return if running on windows
     '''
     self.assertTrue(cmdmod._is_valid_shell('foo'))
예제 #12
0
 def test_is_valid_shell_unavailable(self):
     """
     Tests return when provided shell is not available
     """
     with patch("salt.utils.fopen", mock_open(read_data=MOCK_SHELL_FILE)):
         self.assertFalse(cmdmod._is_valid_shell("foo"))
예제 #13
0
 def test_is_valid_shell_available(self):
     """
     Tests return when provided shell is available
     """
     with patch("salt.utils.fopen", mock_open(read_data=MOCK_SHELL_FILE)):
         self.assertTrue(cmdmod._is_valid_shell("/bin/bash"))
예제 #14
0
 def test_is_valid_shell_none(self):
     """
     Tests return of when os.path.exists(/etc/shells) isn't available
     """
     self.assertIsNone(cmdmod._is_valid_shell("foo"))
예제 #15
0
 def test_is_valid_shell_windows(self):
     """
     Tests return if running on windows
     """
     self.assertTrue(cmdmod._is_valid_shell("foo"))
예제 #16
0
def test_is_valid_shell_windows():
    """
    Tests return if running on windows
    """
    with patch("salt.utils.platform.is_windows", MagicMock(return_value=True)):
        assert cmdmod._is_valid_shell("foo")
예제 #17
0
def test_is_valid_shell_none():
    """
    Tests return of when os.path.exists(/etc/shells) isn't available
    """
    with patch("os.path.exists", MagicMock(return_value=False)):
        assert cmdmod._is_valid_shell("foo") is None
예제 #18
0
파일: cmdmod_test.py 프로젝트: bryson/salt
 def test_is_valid_shell_unavailable(self):
     '''
     Tests return when provided shell is not available
     '''
     with patch('salt.utils.fopen', mock_open(read_data=MOCK_SHELL_FILE)):
         self.assertFalse(cmdmod._is_valid_shell('foo'))