def test_getgoal(self): ''' Test if it returns goal(s) for a file or directory ''' mock = MagicMock(return_value={'stdout': 'Salt: salt'}) with patch.dict(moosefs.__salt__, {'cmd.run_all': mock}): self.assertDictEqual(moosefs.getgoal('/tmp/salt'), {'goal': 'salt'})
def test_getgoal(self): ''' Test if it returns goal(s) for a file or directory ''' mock = MagicMock(return_value={'stdout': 'Salt: salt'}) with patch.dict(moosefs.__salt__, {'cmd.run_all': mock}): self.assertDictEqual(moosefs.getgoal('/tmp/salt'), {'goal': 'salt'})
def test_getgoal(): """ Test if it returns goal(s) for a file or directory """ mock = MagicMock(return_value={"stdout": "Salt: salt"}) with patch.dict(moosefs.__salt__, {"cmd.run_all": mock}): assert moosefs.getgoal("/tmp/salt") == {"goal": "salt"}