Exemplo n.º 1
0
 def test_file_dict(self):
     """
     Test - List the files that belong to a package, grouped by package.
     """
     std_out = "\n".join(self.opkg_vim_files["packages"]["vim"])
     ret_value = {"stdout": std_out}
     mock = MagicMock(return_value=ret_value)
     with patch.dict(opkg.__salt__, {"cmd.run_all": mock}):
         self.assertEqual(opkg.file_dict("vim"), self.opkg_vim_files)
Exemplo n.º 2
0
 def test_file_dict(self):
     '''
     Test - List the files that belong to a package, grouped by package.
     '''
     std_out = '\n'.join(OPKG_VIM_FILES['packages']['vim'])
     ret_value = {'stdout': std_out}
     mock = MagicMock(return_value=ret_value)
     with patch.dict(opkg.__salt__, {'cmd.run_all': mock}):
         self.assertEqual(opkg.file_dict('vim'), OPKG_VIM_FILES)