mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 02:24:16 +02:00
M3 namespace migration: complete Phase B, partial Phase D, docs and tests
- Native runtime under bearhub/ (api, commons, gems, view/util, view/core, view/qt) - bauh/ compatibility re-export shims for legacy imports - Phase D: canonical __version__/__app_name__ in bearhub/__init__.py; pyproject.toml and setup.py point at bearhub package - Native gem loader at bearhub/view/core/gems.py - Namespace compatibility tests (159 tests passing) - Documentation: CHANGELOG [Unreleased], NAMESPACE_MIGRATION, ROADMAP, README, CONTRIBUTING, docs/qt6-migration.md, packaging/aur/README.md
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
from unittest import TestCase
|
||||
from unittest.mock import Mock
|
||||
|
||||
from bauh.gems.flatpak.controller import FlatpakManager
|
||||
from bauh.gems.flatpak.model import FlatpakApplication
|
||||
from bearhub.gems.flatpak.controller import FlatpakManager
|
||||
from bearhub.gems.flatpak.model import FlatpakApplication
|
||||
|
||||
|
||||
class FlatpakManagerSortUpdateOrderTest(TestCase):
|
||||
|
||||
@@ -2,13 +2,13 @@ from unittest import TestCase
|
||||
from unittest.mock import patch, Mock
|
||||
|
||||
|
||||
from bauh.gems.flatpak import flatpak, VERSION_1_2
|
||||
from bearhub.gems.flatpak import flatpak, VERSION_1_2
|
||||
|
||||
|
||||
class FlatpakTest(TestCase):
|
||||
|
||||
@patch("bauh.gems.flatpak.flatpak.SimpleProcess")
|
||||
@patch("bauh.gems.flatpak.flatpak.ProcessHandler.handle_simple", return_value=(True, """
|
||||
@patch("bearhub.gems.flatpak.flatpak.SimpleProcess")
|
||||
@patch("bearhub.gems.flatpak.flatpak.ProcessHandler.handle_simple", return_value=(True, """
|
||||
Looking for updates...
|
||||
|
||||
\tID\tArch\tBranch\tRemote\tDownload
|
||||
|
||||
22
tests/gems/flatpak/test_namespace.py
Normal file
22
tests/gems/flatpak/test_namespace.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from unittest import TestCase
|
||||
|
||||
from bearhub.gems.flatpak.controller import FlatpakManager
|
||||
from bearhub.view.core.gems import _discover_gem_dirs, _import_controller_module
|
||||
|
||||
|
||||
class TestFlatpakNamespace(TestCase):
|
||||
|
||||
def test_bauh_compat_import(self):
|
||||
from bauh.gems.flatpak.model import FlatpakApplication
|
||||
|
||||
self.assertTrue(issubclass(FlatpakApplication, object))
|
||||
|
||||
def test_flatpak_discovered_under_bearhub(self):
|
||||
gem_dirs = dict(_discover_gem_dirs())
|
||||
self.assertIn('flatpak', gem_dirs)
|
||||
self.assertIn('bearhub/gems/flatpak', gem_dirs['flatpak'].replace('\\', '/'))
|
||||
|
||||
def test_controller_import_prefers_bearhub(self):
|
||||
module = _import_controller_module('flatpak')
|
||||
self.assertEqual(module.__name__, 'bearhub.gems.flatpak.controller')
|
||||
self.assertIs(module.FlatpakManager, FlatpakManager)
|
||||
@@ -1,6 +1,6 @@
|
||||
from unittest import TestCase
|
||||
|
||||
from bauh.gems.flatpak.worker import FlatpakAsyncDataLoader
|
||||
from bearhub.gems.flatpak.worker import FlatpakAsyncDataLoader
|
||||
|
||||
|
||||
class FlatpakAsyncDataLoaderTest(TestCase):
|
||||
|
||||
Reference in New Issue
Block a user