def test_remove_dir(self, os_mock, shutil_mock): path = 'dir_for_removing' os_mock.path.isdir.return_value = True os_mock.path.islink.return_value = False utils.remove(path) shutil_mock.rmtree.assert_called_once_with(path) self.method_was_not_called(os_mock.remove)
def clean(self): utils.remove(self.build_dir) utils.create_dir(self.build_dir) utils.remove_by_mask(self.result_package_mask)
def test_remove_file(self, os_mock, shutil_mock): path = 'file_for_removing' os_mock.path.isdir.return_value = False utils.remove(path) os_mock.remove.assert_called_once_with(path) self.method_was_not_called(shutil_mock.rmtree)
def clean(self): utils.remove(self.build_dir) utils.create_dir(self.build_dir)