mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-06 22:54: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,10 +1,10 @@
|
||||
from unittest import TestCase
|
||||
from unittest.mock import Mock, patch
|
||||
|
||||
from bauh.gems.web.controller import DEFAULT_LANGUAGE_HEADER
|
||||
from bauh.gems.web.controller import WebApplicationManager
|
||||
from bearhub.gems.web.controller import DEFAULT_LANGUAGE_HEADER
|
||||
from bearhub.gems.web.controller import WebApplicationManager
|
||||
|
||||
LOCALE_TARGET = 'bauh.gems.web.controller.locale.getlocale'
|
||||
LOCALE_TARGET = 'bearhub.gems.web.controller.locale.getlocale'
|
||||
|
||||
|
||||
class ControllerTest(TestCase):
|
||||
|
||||
22
tests/gems/web/test_namespace.py
Normal file
22
tests/gems/web/test_namespace.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from unittest import TestCase
|
||||
|
||||
from bearhub.gems.web.controller import WebApplicationManager
|
||||
from bearhub.view.core.gems import _discover_gem_dirs, _import_controller_module
|
||||
|
||||
|
||||
class TestWebNamespace(TestCase):
|
||||
|
||||
def test_bauh_compat_import(self):
|
||||
from bauh.gems.web.controller import DEFAULT_LANGUAGE_HEADER
|
||||
|
||||
self.assertEqual('en-US, en', DEFAULT_LANGUAGE_HEADER)
|
||||
|
||||
def test_web_discovered_under_bearhub(self):
|
||||
gem_dirs = dict(_discover_gem_dirs())
|
||||
self.assertIn('web', gem_dirs)
|
||||
self.assertIn('bearhub/gems/web', gem_dirs['web'].replace('\\', '/'))
|
||||
|
||||
def test_controller_import_prefers_bearhub(self):
|
||||
module = _import_controller_module('web')
|
||||
self.assertEqual(module.__name__, 'bearhub.gems.web.controller')
|
||||
self.assertIs(module.WebApplicationManager, WebApplicationManager)
|
||||
Reference in New Issue
Block a user