def test_owner(): """ Test - Return the name of the package that owns the file. """ paths = ["/usr/bin/wget"] mock = MagicMock(return_value="wget: /usr/bin/wget") with patch.dict(aptpkg.__salt__, {"cmd.run_stdout": mock}): assert aptpkg.owner(*paths) == "wget"
def test_owner(self): ''' Test - Return the name of the package that owns the file. ''' paths = ['/usr/bin/wget'] mock = MagicMock(return_value='wget: /usr/bin/wget') with patch.dict(aptpkg.__salt__, {'cmd.run_stdout': mock}): self.assertEqual(aptpkg.owner(*paths), 'wget')
def test_owner(self): ''' Test - Return the name of the package that owns the file. ''' assert aptpkg.owner('/usr/bin/wget') == 'wget'