Make latest black happy

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
(cherry picked from commit dd7ecbd5fd)
This commit is contained in:
Lubomír Sedlář 2024-01-26 09:21:20 +01:00 committed by Stepan Oksanichenko
parent dc05d1fbba
commit a9839d8078
Signed by: soksanichenko
GPG Key ID: AB9983172AB1E45B
5 changed files with 20 additions and 25 deletions

View File

@ -236,9 +236,9 @@ class Runroot(kobo.log.LoggingBase):
fmt_dict["runroot_key"] = runroot_key fmt_dict["runroot_key"] = runroot_key
self._ssh_run(hostname, user, run_template, fmt_dict, log_file=log_file) self._ssh_run(hostname, user, run_template, fmt_dict, log_file=log_file)
fmt_dict[ fmt_dict["command"] = (
"command" "rpm -qa --qf='%{name}-%{version}-%{release}.%{arch}\n'"
] = "rpm -qa --qf='%{name}-%{version}-%{release}.%{arch}\n'" )
buildroot_rpms = self._ssh_run( buildroot_rpms = self._ssh_run(
hostname, hostname,
user, user,

View File

@ -478,8 +478,7 @@ def main():
print("RPM size: %s MiB" % (mypungi.size_packages() / 1024**2)) print("RPM size: %s MiB" % (mypungi.size_packages() / 1024**2))
if not opts.nodebuginfo: if not opts.nodebuginfo:
print( print(
"DEBUGINFO size: %s MiB" "DEBUGINFO size: %s MiB" % (mypungi.size_debuginfo() / 1024**2)
% (mypungi.size_debuginfo() / 1024**2)
) )
if not opts.nosource: if not opts.nosource:
print("SRPM size: %s MiB" % (mypungi.size_srpms() / 1024**2)) print("SRPM size: %s MiB" % (mypungi.size_srpms() / 1024**2))

View File

@ -888,10 +888,8 @@ class GetIsoContentsTest(helpers.PungiTestCase):
"images/efiboot.img": os.path.join(iso_dir, "images/efiboot.img"), "images/efiboot.img": os.path.join(iso_dir, "images/efiboot.img"),
} }
ggp.side_effect = ( ggp.side_effect = lambda compose, x: (
lambda compose, x: gp[x[0][len(self.topdir) + 1 :]] gp[x[0][len(self.topdir) + 1 :]] if len(x) == 1 else bi_gp
if len(x) == 1
else bi_gp
) )
gp_file = os.path.join(self.topdir, "work/x86_64/iso/my.iso-graft-points") gp_file = os.path.join(self.topdir, "work/x86_64/iso/my.iso-graft-points")

View File

@ -1057,10 +1057,8 @@ class TestGatherPackages(helpers.PungiTestCase):
@mock.patch("pungi.phases.gather.get_gather_method") @mock.patch("pungi.phases.gather.get_gather_method")
def test_hybrid_method(self, get_gather_method, get_variant_packages): def test_hybrid_method(self, get_gather_method, get_variant_packages):
packages, groups, filters = mock.Mock(), mock.Mock(), mock.Mock() packages, groups, filters = mock.Mock(), mock.Mock(), mock.Mock()
get_variant_packages.side_effect = ( get_variant_packages.side_effect = lambda c, v, a, s, p: (
lambda c, v, a, s, p: (packages, groups, filters) (packages, groups, filters) if s == "comps" else (None, None, None)
if s == "comps"
else (None, None, None)
) )
get_gather_method.return_value.return_value.return_value = { get_gather_method.return_value.return_value.return_value = {
"rpm": [], "rpm": [],

View File

@ -82,12 +82,12 @@ class TestRunrootOpenSSH(helpers.PungiTestCase):
@mock.patch("pungi.runroot.run") @mock.patch("pungi.runroot.run")
def test_run_templates(self, run): def test_run_templates(self, run):
self.compose.conf[ self.compose.conf["runroot_ssh_init_template"] = (
"runroot_ssh_init_template" "/usr/sbin/init_runroot {runroot_tag}"
] = "/usr/sbin/init_runroot {runroot_tag}" )
self.compose.conf[ self.compose.conf["runroot_ssh_install_packages_template"] = (
"runroot_ssh_install_packages_template" "install {runroot_key} {packages}"
] = "install {runroot_key} {packages}" )
self.compose.conf["runroot_ssh_run_template"] = "run {runroot_key} {command}" self.compose.conf["runroot_ssh_run_template"] = "run {runroot_key} {command}"
run.return_value = (0, "key\n") run.return_value = (0, "key\n")
@ -111,9 +111,9 @@ class TestRunrootOpenSSH(helpers.PungiTestCase):
@mock.patch("pungi.runroot.run") @mock.patch("pungi.runroot.run")
def test_run_templates_no_init(self, run): def test_run_templates_no_init(self, run):
self.compose.conf[ self.compose.conf["runroot_ssh_install_packages_template"] = (
"runroot_ssh_install_packages_template" "install {packages}"
] = "install {packages}" )
self.compose.conf["runroot_ssh_run_template"] = "run {command}" self.compose.conf["runroot_ssh_run_template"] = "run {command}"
run.return_value = (0, "key\n") run.return_value = (0, "key\n")
@ -136,9 +136,9 @@ class TestRunrootOpenSSH(helpers.PungiTestCase):
@mock.patch("pungi.runroot.run") @mock.patch("pungi.runroot.run")
def test_run_templates_no_packages(self, run): def test_run_templates_no_packages(self, run):
self.compose.conf[ self.compose.conf["runroot_ssh_install_packages_template"] = (
"runroot_ssh_install_packages_template" "install {packages}"
] = "install {packages}" )
self.compose.conf["runroot_ssh_run_template"] = "run {command}" self.compose.conf["runroot_ssh_run_template"] = "run {command}"
run.return_value = (0, "key\n") run.return_value = (0, "key\n")