コード例 #1
0
def test_exists():
    """
    Test to check if the directory is configured
    """
    mock = MagicMock(return_value=["C:\\Foo", "C:\\Bar"])
    with patch.object(win_path, "get_path", mock):
        # Ensure case insensitivity respected
        assert (win_path.exists("C:\\FOO")) is True
        assert (win_path.exists("c:\\foo")) is True
        assert (win_path.exists("c:\\mystuff")) is False
コード例 #2
0
ファイル: test_win_path.py プロジェクト: morinap/salt-1
 def test_exists(self):
     '''
     Test to check if the directory is configured
     '''
     get_mock = MagicMock(return_value=['C:\\Foo', 'C:\\Bar'])
     with patch.object(win_path, 'get_path', get_mock):
         # Ensure case insensitivity respected
         self.assertTrue(win_path.exists('C:\\FOO'))
         self.assertTrue(win_path.exists('c:\\foo'))
         self.assertFalse(win_path.exists('c:\\mystuff'))
コード例 #3
0
ファイル: test_win_path.py プロジェクト: vindir/salt
 def test_exists(self):
     '''
         Test to check if the directory is configured
     '''
     mock = MagicMock(return_value='c:\\salt')
     with patch.object(win_path, 'get_path', mock):
         self.assertTrue(win_path.exists("c:\\salt"))
コード例 #4
0
ファイル: win_path_test.py プロジェクト: DaveQB/salt
 def test_exists(self):
     """
         Test to check if the directory is configured
     """
     mock = MagicMock(return_value="c:\\salt")
     with patch.object(win_path, "get_path", mock):
         self.assertTrue(win_path.exists("c:\\salt"))
コード例 #5
0
ファイル: win_path_test.py プロジェクト: HowardMei/saltstack
 def test_exists(self):
     '''
         Test to check if the directory is configured
     '''
     mock = MagicMock(return_value='c:\\salt')
     with patch.object(win_path, 'get_path', mock):
         self.assertTrue(win_path.exists("c:\\salt"))