예제 #1
0
 def test_client(self):
     '''
     Test if it execute a chef client run and return a dict
     '''
     with patch.dict(chef.__opts__,
                     {'cachedir': r'c:\salt\var\cache\salt\minion'}):
         self.assertDictEqual(chef.client(), {})
예제 #2
0
파일: test_chef.py 프로젝트: zxstar/salt
 def test_client(self):
     """
     Test if it execute a chef client run and return a dict
     """
     with patch.dict(chef.__opts__,
                     {"cachedir": r"c:\salt\var\cache\salt\minion"}):
         self.assertDictEqual(chef.client(), {})
예제 #3
0
파일: test_chef.py 프로젝트: mcalmer/salt
def test_client():
    """
    Test to run chef-client
    """
    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})
            assert chef.client(name) == ret
예제 #4
0
파일: test_chef.py 프로젝트: vindir/salt
 def test_client(self):
     '''
     Test if it execute a chef client run and return a dict
     '''
     self.assertDictEqual(chef.client(), {})
예제 #5
0
 def test_client(self):
     """
     Test if it execute a chef client run and return a dict
     """
     with patch("salt.utils.path.which", MagicMock(return_value=True)):
         self.assertDictEqual(chef.client(), {})
예제 #6
0
파일: chef_test.py 프로젝트: DaveQB/salt
 def test_client(self):
     '''
     Test if it execute a chef client run and return a dict
     '''
     self.assertDictEqual(chef.client(), {})