Make latest black happy

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2024-01-26 09:21:20 +01:00
parent ba613563f6
commit dd7ecbd5fd
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
self._ssh_run(hostname, user, run_template, fmt_dict, log_file=log_file)
fmt_dict[
"command"
] = "rpm -qa --qf='%{name}-%{version}-%{release}.%{arch}\n'"
fmt_dict["command"] = (
"rpm -qa --qf='%{name}-%{version}-%{release}.%{arch}\n'"
)
buildroot_rpms = self._ssh_run(
hostname,
user,

View File

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

View File

@ -863,10 +863,8 @@ class GetIsoContentsTest(helpers.PungiTestCase):
"images/efiboot.img": os.path.join(iso_dir, "images/efiboot.img"),
}
ggp.side_effect = (
lambda compose, x: gp[x[0][len(self.topdir) + 1 :]]
if len(x) == 1
else bi_gp
ggp.side_effect = lambda compose, x: (
gp[x[0][len(self.topdir) + 1 :]] if len(x) == 1 else bi_gp
)
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")
def test_hybrid_method(self, get_gather_method, get_variant_packages):
packages, groups, filters = mock.Mock(), mock.Mock(), mock.Mock()
get_variant_packages.side_effect = (
lambda c, v, a, s, p: (packages, groups, filters)
if s == "comps"
else (None, None, None)
get_variant_packages.side_effect = lambda c, v, a, s, p: (
(packages, groups, filters) if s == "comps" else (None, None, None)
)
get_gather_method.return_value.return_value.return_value = {
"rpm": [],

View File

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