def test_version(self): """ Test if it returns the version of locate """ mock = MagicMock(return_value="mlocate 0.26") with patch.dict(locate.__salt__, {"cmd.run": mock}): self.assertListEqual(locate.version(), ["mlocate 0.26"])
def test_version(self): ''' Test if it returns the version of locate ''' mock = MagicMock(return_value='mlocate 0.26') with patch.dict(locate.__salt__, {'cmd.run': mock}): self.assertListEqual(locate.version(), ['mlocate 0.26'])