flake warnings (#304)

This commit is contained in:
Bruno Cabral
2022-12-12 02:44:27 -08:00
committed by GitHub
parent f10a3f1d1a
commit fb4109bd77
67 changed files with 252 additions and 248 deletions

View File

@@ -58,7 +58,7 @@ gimp-help^<none>^<none>^<none>^^
self.assertEqual([p.__dict__ for p in exp], [p.__dict__ for p in res])
@patch(f'{__app_name__}.gems.debian.aptitude.system.execute', return_value=(0, """
Package: firefox
Package: firefox
Version: 97.0+distro1+una
State: installed (95.0.1+distro1.1+una), upgrade available (97.0+distro1+una)
Automatically installed: no
@@ -89,8 +89,8 @@ Suggests: gcc-multilib, make, manpages-dev, autoconf, automake, libtool, flex, b
Conflicts: gcc-doc (< 1:2.95.3), gcc-doc:i386 (< 1:2.95.3), gcc:i386
Provides: c-compiler, gcc-x86-64-linux-gnu (= 4:9.3.0-1distro2), gcc:amd64 (= 4:9.3.0-1distro2)
Description: GNU C compiler
This is the GNU C compiler, a fairly portable optimizing compiler for C.
This is the GNU C compiler, a fairly portable optimizing compiler for C.
This is a dependency package providing the default GNU C compiler.
"""))
@@ -170,7 +170,7 @@ Description: GNU C compiler
def test_map_transaction_output__it_should_map_i386_packages(self):
output = "\nThe following NEW packages will be installed:\n" \
" gcc-12-base:i386{a} [12.1.0-2distro~22.04] <+272 kB> glib-networking:i386{a} [2.72.0-1] <+242 kB>\n" \
"\nThe following packages will be REMOVED:\n" \
"\nThe following packages will be REMOVED:\n" \
" celluloid{a} [0.21-linux+distro] <-1066 kB> libpcre3:i386{a} [2:8.39-13distro0.22.04.1] <-714 kB>"
transaction = self.aptitude.map_transaction_output(output)

View File

@@ -14,14 +14,14 @@ class DebianPackageManagerTest(TestCase):
self.controller._apps_index = {}
@patch(f'{__app_name__}.gems.debian.controller.Aptitude.read_installed', return_value=iter((
DebianPackage(name='gir1.2-javascriptcoregtk-4.0', version='2.34.1-0distro0.20.04.1',
latest_version='2.34.1-0distro0.20.04.1',
maintainer='Distro Developers', update=False, installed=True,
description='JavaScript engine library from WebKitGTK - GObject introspection data'),
DebianPackage(name='xwayland', version='2:1.20.13-1distro1~20.04.2',
latest_version='2:1.20.13-1distro1~20.04.2',
maintainer='Distro X-SWAT', update=False, installed=True,
description='Xwayland X server')
DebianPackage(name='gir1.2-javascriptcoregtk-4.0', version='2.34.1-0distro0.20.04.1',
latest_version='2.34.1-0distro0.20.04.1',
maintainer='Distro Developers', update=False, installed=True,
description='JavaScript engine library from WebKitGTK - GObject introspection data'),
DebianPackage(name='xwayland', version='2:1.20.13-1distro1~20.04.2',
latest_version='2:1.20.13-1distro1~20.04.2',
maintainer='Distro X-SWAT', update=False, installed=True,
description='Xwayland X server')
)))
def test_read_installed__must_associated_packages_found_to_applications_if_appliable(self, read_installed: Mock):
app = DebianApplication(name='xwayland', exe_path='xwayland', icon_path='xwayland', categories=('app',))
@@ -44,14 +44,14 @@ class DebianPackageManagerTest(TestCase):
self.assertEqual(expected, result.installed)
@patch(f'{__app_name__}.gems.debian.controller.Aptitude.read_installed', return_value=iter((
DebianPackage(name='gir1.2-javascriptcoregtk-4.0', version='2.34.1-0distro0.20.04.1',
latest_version='2.34.1-0distro0.20.04.1',
maintainer='Distro Developers', update=False, installed=True,
description='JavaScript engine library from WebKitGTK - GObject introspection data'),
DebianPackage(name='xwayland', version='2:1.20.13-1distro1~20.04.2',
latest_version='2:1.20.13-1distro1~20.04.2',
maintainer='Distro X-SWAT', update=False, installed=True,
description='Xwayland X server')
DebianPackage(name='gir1.2-javascriptcoregtk-4.0', version='2.34.1-0distro0.20.04.1',
latest_version='2.34.1-0distro0.20.04.1',
maintainer='Distro Developers', update=False, installed=True,
description='JavaScript engine library from WebKitGTK - GObject introspection data'),
DebianPackage(name='xwayland', version='2:1.20.13-1distro1~20.04.2',
latest_version='2:1.20.13-1distro1~20.04.2',
maintainer='Distro X-SWAT', update=False, installed=True,
description='Xwayland X server')
)))
def test_read_installed__internet_not_available(self, read_installed: Mock):
result = self.controller.read_installed(disk_loader=None, pkg_types=None, internet_available=False)
@@ -83,7 +83,7 @@ class DebianPackageManagerTest(TestCase):
)))
def test_search__returned_packages_should_be_associated_with_apps_if_appliable(self, search: Mock):
app = DebianApplication(name='myapp', exe_path='myapp', icon_path='myapp',
categories=('app',))
categories=('app',))
self.controller._apps_index = {'myapp': app}
words = 'test'

View File

@@ -8,6 +8,7 @@ from bauh.gems.debian.index import ApplicationsMapper, ApplicationIndexer
from bauh.gems.debian.model import DebianApplication
from tests.gems.debian import DEBIAN_TESTS_DIR
def mock_read_file(fpath: str):
if fpath.endswith('firefox.desktop'):
return """