Ejemplo n.º 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
Ejemplo n.º 2
0
 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'))
Ejemplo n.º 3
0
 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"))
Ejemplo n.º 4
0
 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"))
Ejemplo n.º 5
0
 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"))