def test_get_dir_success(self):
        path = 'salt://saltines'
        dest = '/srv/salt/cheese'
        saltenv = 'base'
        ret = (path, dest, saltenv, None)

        class MockFileClient(object):
            def get_dir(self, *args):
                return args

        mock_file_client = MockFileClient()
        with patch.dict(cp.__context__, {'cp.fileclient': mock_file_client}):
            with patch('salt.modules.cp._render_filenames',
                       MagicMock(return_value=(path, dest))):
                self.assertEqual(cp.get_dir(path, dest), ret)
Test if get_template succeeds.
dataset/ETHPy150Open saltstack/salt/tests/unit/modules/cp_test.py/CpTestCase.test_get_dir_success