def test_client(self):
        name = 'my-chef-run'

        ret = {'name': name,
               'result': False,
               'changes': {},
               'comment': ''}

        mock = MagicMock(return_value={'retcode': 1, 'stdout': '',
                                       'stderr': 'error'})
        with patch.dict(chef.__salt__, {'chef.client': mock}):
            with patch.dict(chef.__opts__, {'test': True}):
                comt = ('\nerror')
                ret.update({'comment': comt})
                self.assertDictEqual(chef.client(name), ret)

    # 'solo' function tests: 1
Test to run chef-client
dataset/ETHPy150Open saltstack/salt/tests/unit/states/chef_test.py/ChefTestCase.test_client