Unit test pacman_cache() parse logic without pacman installed
(self, mock_path, mock_exe_exists, mock_run)
| 781 | @mock.patch('bleachbit.Unix.exe_exists') |
| 782 | @mock.patch('bleachbit.Unix.os.path') |
| 783 | def test_pacman_cache_mock(self, mock_path, mock_exe_exists, mock_run): |
| 784 | """Unit test pacman_cache() parse logic without pacman installed""" |
| 785 | mock_path.exists.return_value = False |
| 786 | mock_exe_exists.return_value = True |
| 787 | mock_run.return_value = ( |
| 788 | 0, |
| 789 | "==> finished: 3 packages removed (42.31 M freed)\n", |
| 790 | '' |
| 791 | ) |
| 792 | |
| 793 | bytes_freed = pacman_cache() |
| 794 | self.assertEqual(bytes_freed, 42310000) |
| 795 | |
| 796 | mock_run.assert_called_once_with(['paccache', '-rk0']) |
| 797 | |
| 798 | @common.skipIfWindows |
| 799 | @common.skipUnlessDestructive |
nothing calls this directly
no test coverage detected