@patch('salt.modules.cp.hash_file', MagicMock(return_value=True))
    def test_get_file_success(self):
        path = 'salt://saltines'
        dest = '/srv/salt/cheese'
        saltenv = 'base'
        ret = (path, dest, False, saltenv, None)

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

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