Package: command-not-found
Version: 23.04.0-2
Severity: normal
Tags: patch
User: reproducible-bui...@lists.alioth.debian.org
Usertag: environment

Hi,

in a clean environment without /etc/apt/sources.list(.d/*), command-not-found's build-time tests fail like this:


======================================================================
FAIL: test_from_table 
(CommandNotFound.tests.test_command_not_found.CommandNotFoundOutputTest.test_from_table)
----------------------------------------------------------------------
Traceback (most recent call last):
  File 
"/build/reproducible-path/command-not-found-23.04.0/CommandNotFound/tests/test_command_not_found.py",
 line 149, in test_from_table
    self._test_spec(spec)
    ~~~~~~~~~~~~~~~^^^^^^
  File 
"/build/reproducible-path/command-not-found-23.04.0/CommandNotFound/tests/test_command_not_found.py",
 line 191, in _test_spec
    self.assertEqual(output, expected_output, "test '%s' broken" % test)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: "Comm[87 chars]0, or (You will have to enable component calle[97 
chars]')\n" != "Comm[87 chars]0, or\nsudo apt install neovim  # version 2.0\n"
  Command 'x-vi' not found, but can be installed with:
- sudo apt install vim     # version 1.0, or (You will have to enable component 
called 'main')
- sudo apt install neovim  # version 2.0 (You will have to enable component 
called 'main')
+ sudo apt install vim     # version 1.0, or
+ sudo apt install neovim  # version 2.0
 : test 'multi advise debs' broken


Please find a patch attached, avoiding this problem.

Please apply it.

Thanks,
Chris

--- 
command-not-found-23.04.0.orig/CommandNotFound/tests/test_command_not_found.py
+++ command-not-found-23.04.0/CommandNotFound/tests/test_command_not_found.py
@@ -121,6 +121,7 @@ class CommandNotFoundOutputTest(unittest
         #        and for sudo/no-sudo
         self.cnf.euid = 1000
         self.cnf.user_can_sudo = True
+        self.cnf.sources_list = ["main"]
 
     def tearDown(self):
         shutil.rmtree(self.tmpdir)

Reply via email to