public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/fedpkg] 1.48-1: Patch: Fix unittests after '--path' argument is validated
@ 2026-08-10 21:46 
  0 siblings, 0 replies; only message in thread
From:  @ 2026-08-10 21:46 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/fedpkg
            Branch : 1.48-1
            Commit : b905b9cd2347b5bc606aa5cc2a20fb6e4042dd77
            Author : Ondřej Nosek <onosek@redhat.com>
            Date   : 2023-04-02T23:02:57+00:00
            Stats  : +58/-5 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/fedpkg/c/b905b9cd2347b5bc606aa5cc2a20fb6e4042dd77?branch=1.48-1

            Log:
            Patch: Fix unittests after '--path' argument is validated

Signed-off-by: Ondřej Nosek <onosek@redhat.com>

---
diff --git a/0004-Fix-unittests-after-path-argument-is-validated.patch b/0004-Fix-unittests-after-path-argument-is-validated.patch
new file mode 100644
index 0000000..5b65471
--- /dev/null
+++ b/0004-Fix-unittests-after-path-argument-is-validated.patch
@@ -0,0 +1,49 @@
+From e48214a679ed394079a3af684877f0acaae50866 Mon Sep 17 00:00:00 2001
+From: Ondrej Nosek <onosek@redhat.com>
+Date: Mon, 3 Apr 2023 00:20:00 +0200
+Subject: [PATCH] Fix unittests after '--path' argument is validated
+
+Signed-off-by: Ondrej Nosek <onosek@redhat.com>
+---
+ test/test_cli.py | 17 +++++++++++------
+ 1 file changed, 11 insertions(+), 6 deletions(-)
+
+diff --git a/test/test_cli.py b/test/test_cli.py
+index 84d1935..ecc279d 100644
+--- a/test/test_cli.py
++++ b/test/test_cli.py
+@@ -10,6 +10,7 @@
+ # option) any later version.  See http://www.gnu.org/copyleft/gpl.html for
+ # the full text of the license.
+ 
++import argparse
+ import io
+ import json
+ import os
+@@ -2306,13 +2307,17 @@ class TestReadReleasesFromLocalConfig(CliTestCase):
+         self.write_file(self.package_cfg,
+                         content='[koji]\ntargets=rawhide f28 fedora epel')
+ 
+-    @patch('os.path.exists', return_value=False)
+-    def test_no_config_file_is_create(self, exists):
++    @patch('pyrpkg.utils.validate_path')
++    def test_no_config_file_is_create(self, validate_path):
++        error_msg = 'given path \'{0}\' doesn\'t exist'.format(self.cloned_repo_path)
++        validate_path.side_effect=argparse.ArgumentTypeError(error_msg)
+         with patch('sys.argv', new=self.fake_cmd):
+-            cli = self.new_cli()
+-
+-        rels = cli.read_releases_from_local_config(self.active_releases)
+-        self.assertIsNone(rels)
++            with patch('sys.stderr', new=six.StringIO()):
++                with self.assertRaises(SystemExit):  # argparse.ArgumentTypeError turns to SystemExit
++                    self.new_cli()
++                validate_path.assert_called_once_with(self.cloned_repo_path)
++                output = sys.stderr.getvalue().strip()
++                self.assertIn(error_msg, output)
+ 
+     def test_no_build_target_is_configured(self):
+         with patch('sys.argv', new=self.fake_cmd):
+-- 
+2.39.2
+

diff --git a/fedpkg.spec b/fedpkg.spec
index ef85c6b..6493acc 100644
--- a/fedpkg.spec
+++ b/fedpkg.spec
@@ -5,7 +5,7 @@
 
 Name:           fedpkg
 Version:        1.44
-Release:        2%{?dist}
+Release:        3%{?dist}
 Summary:        Fedora utility for working with dist-git
 
 License:        GPLv2+
@@ -25,6 +25,7 @@ Patch2:         0002-Remove-pytest-coverage-execution.patch
 %if %{with python2}
 Patch3:         0003-Remove-Environment-Markers-syntax.patch
 %endif
+Patch4:         0004-Fix-unittests-after-path-argument-is-validated.patch
 
 BuildRequires:  pkgconfig
 BuildRequires:  bash-completion
@@ -39,7 +40,7 @@ Requires:       redhat-rpm-config
 
 BuildRequires:  python2-devel
 # We br these things for man page generation due to imports
-BuildRequires:  python2-rpkg >= 1.66-3
+BuildRequires:  python2-rpkg >= 1.66-5
 BuildRequires:  python2-distro
 BuildRequires:  python2-fedora
 # For testing
@@ -53,7 +54,7 @@ BuildRequires:  python-bugzilla
 
 Requires:       bodhi-client >= 2.0
 Requires:       python-bugzilla
-Requires:       python2-rpkg >= 1.66-3
+Requires:       python2-rpkg >= 1.66-5
 Requires:       python2-distro
 Requires:       python2-fedora
 Requires:       python2-openidc-client >= 0.6.0
@@ -65,7 +66,7 @@ Requires:       fedora-packager
 %global __python %{__python3}
 
 BuildRequires:  python3-devel
-BuildRequires:  python3-rpkg >= 1.66-3
+BuildRequires:  python3-rpkg >= 1.66-5
 BuildRequires:  python3-distro
 BuildRequires:  python3-fedora
 # For testing
@@ -77,7 +78,7 @@ BuildRequires:  python3-bodhi-client
 
 
 Requires:       python3-bugzilla
-Requires:       python3-rpkg >= 1.66-3
+Requires:       python3-rpkg >= 1.66-5
 Requires:       python3-distro
 Requires:       python3-fedora
 Requires:       python3-openidc-client >= 0.6.0
@@ -147,6 +148,9 @@ mv %{buildroot}%{compdir}/fedpkg.bash %{buildroot}%{compdir}/fedpkg
 
 
 %changelog
+* Mon Apr 3 2023 Ondřej Nosek <onosek@redhat.com> - 1.44-3
+- Patch: Fix unittests after '--path' argument is validated
+
 * Wed Mar 1 2023 Ondřej Nosek <onosek@redhat.com> - 1.44-2
 - Require a bumped rpkg version
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-10 21:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-10 21:46 [rpms/fedpkg] 1.48-1: Patch: Fix unittests after '--path' argument is validated 

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox