mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 01:14:15 +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:
23
tests/view/core/test_namespace.py
Normal file
23
tests/view/core/test_namespace.py
Normal file
@@ -0,0 +1,23 @@
|
||||
from unittest import TestCase
|
||||
|
||||
from bearhub.view.core.config import CoreConfigManager
|
||||
from bearhub.view.core.controller import GenericSoftwareManager
|
||||
from bearhub.view.core.gems import load_managers
|
||||
from bearhub.view.core.update import check_for_update
|
||||
|
||||
|
||||
class TestViewCoreNamespace(TestCase):
|
||||
|
||||
def test_bauh_compat_import(self):
|
||||
from bauh.view.core.config import CoreConfigManager as legacy_config
|
||||
|
||||
self.assertIs(legacy_config, CoreConfigManager)
|
||||
|
||||
def test_controller_importable_from_bearhub(self):
|
||||
self.assertTrue(callable(GenericSoftwareManager))
|
||||
|
||||
def test_gems_loader_native(self):
|
||||
self.assertTrue(callable(load_managers))
|
||||
|
||||
def test_update_check_callable(self):
|
||||
self.assertTrue(callable(check_for_update))
|
||||
0
tests/view/qt/__init__.py
Normal file
0
tests/view/qt/__init__.py
Normal file
19
tests/view/qt/test_namespace.py
Normal file
19
tests/view/qt/test_namespace.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from unittest import TestCase
|
||||
|
||||
from bearhub.view.qt.prepare import PreparePanel
|
||||
from bearhub.view.qt.window import ManageWindow
|
||||
from bearhub.view.qt.components import QtComponentsManager
|
||||
|
||||
|
||||
class TestViewQtNamespace(TestCase):
|
||||
|
||||
def test_bauh_compat_import(self):
|
||||
from bauh.view.qt.components import QtComponentsManager as legacy_manager
|
||||
|
||||
self.assertIs(legacy_manager, QtComponentsManager)
|
||||
|
||||
def test_prepare_panel_importable(self):
|
||||
self.assertTrue(callable(PreparePanel))
|
||||
|
||||
def test_window_importable(self):
|
||||
self.assertTrue(callable(ManageWindow))
|
||||
0
tests/view/util/__init__.py
Normal file
0
tests/view/util/__init__.py
Normal file
20
tests/view/util/test_namespace.py
Normal file
20
tests/view/util/test_namespace.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from unittest import TestCase
|
||||
|
||||
from bearhub.view.util.cache import DefaultMemoryCacheFactory
|
||||
from bearhub.view.util.resource import get_path
|
||||
from bearhub.view.util.translation import I18n
|
||||
|
||||
|
||||
class TestViewUtilNamespace(TestCase):
|
||||
|
||||
def test_bauh_compat_import(self):
|
||||
from bauh.view.util.cache import DefaultMemoryCacheFactory as legacy_factory
|
||||
|
||||
self.assertIs(legacy_factory, DefaultMemoryCacheFactory)
|
||||
|
||||
def test_resource_prefers_bearhub_tree(self):
|
||||
path = get_path('locale/about/en')
|
||||
self.assertIn('bearhub/view/resources', path.replace('\\', '/'))
|
||||
|
||||
def test_translation_class_available(self):
|
||||
self.assertTrue(callable(I18n))
|
||||
Reference in New Issue
Block a user