def test_list(self): ''' Test if it list installed Perl module ''' mock = MagicMock(return_value='') with patch.dict(cpan.__salt__, {'cmd.run': mock}): self.assertDictEqual(cpan.list_(), {})
def test_list(self): """ Test if it list installed Perl module """ mock = MagicMock(return_value="") with patch.dict(cpan.__salt__, {"cmd.run": mock}): self.assertDictEqual(cpan.list_(), {})
def test_list(self): ''' Test if it list installed Perl module ''' mock = MagicMock(return_value={}) with patch.object(salt.utils.path, 'which', MagicMock(return_value='/usr/bin/cpan')): with patch.dict(cpan.__salt__, {'cmd.run_all': mock}): self.assertDictEqual(cpan.list_(), {})