1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-09-05 20:58:42 +02:00

Fix unit tests to use the new code path to run osc

This commit is contained in:
2025-07-31 11:43:22 +02:00
parent 92dfa1c6d7
commit d00e60d99e

View File

@@ -234,10 +234,12 @@ class OscTestCase(unittest.TestCase):
def _run_osc(self, *args):
"""Runs osc, returning captured STDOUT as a string."""
with unittest.mock.patch.dict(os.environ, {"OSC_CONFIG": self.oscrc}):
cli = osc.commandline.Osc()
argv = ['osc', '--no-keyring']
argv = ["--no-keyring"]
argv.extend(args)
cli.main(argv=argv)
try:
osc.commandline.OscMainCommand.main(argv)
except SystemExit:
pass
return sys.stdout.getvalue()
def _change_to_pkg(self, name):