def test_dirinfo(self): ''' Test if it return information on a directory located on the Moose ''' mock = MagicMock(return_value={'stdout': 'Salt:salt'}) with patch.dict(moosefs.__salt__, {'cmd.run_all': mock}): self.assertDictEqual(moosefs.dirinfo('/tmp/salt'), {'Salt': 'salt'})
def test_dirinfo(): """ Test if it return information on a directory located on the Moose """ mock = MagicMock(return_value={"stdout": "Salt:salt"}) with patch.dict(moosefs.__salt__, {"cmd.run_all": mock}): assert moosefs.dirinfo("/tmp/salt") == {"Salt": "salt"}