Browse Source

[MIG] base_manifest_extension: Migrate to v10

* Rename manifest file and change all openerp references to odoo
* Make minor test fixes
pull/1004/head
Oleg Bulkin 7 years ago
committed by Jairo Llopis
parent
commit
0aca7e75d2
  1. 2
      base_manifest_extension/__manifest__.py
  2. 6
      base_manifest_extension/hooks.py
  3. 13
      base_manifest_extension/tests/test_hooks.py

2
base_manifest_extension/__openerp__.py → base_manifest_extension/__manifest__.py

@ -5,7 +5,7 @@
{ {
'name': 'Module Manifest - Extra Options', 'name': 'Module Manifest - Extra Options',
'version': '9.0.1.0.0',
'version': '10.0.1.0.0',
'website': 'https://github.com/OCA/server-tools', 'website': 'https://github.com/OCA/server-tools',
'author': 'Therp BV, LasLabs, Odoo Community Association (OCA)', 'author': 'Therp BV, LasLabs, Odoo Community Association (OCA)',
'license': 'LGPL-3', 'license': 'LGPL-3',

6
base_manifest_extension/hooks.py

@ -5,9 +5,9 @@
import inspect import inspect
from werkzeug.local import Local from werkzeug.local import Local
from openerp.sql_db import Cursor
from openerp.modules import module
from openerp.modules.graph import Graph
from odoo.sql_db import Cursor
from odoo.modules import module
from odoo.modules.graph import Graph
original = module.load_information_from_description_file original = module.load_information_from_description_file
local = Local() local = Local()

13
base_manifest_extension/tests/test_hooks.py

@ -6,12 +6,12 @@
from mock import Mock, patch from mock import Mock, patch
import os import os
import tempfile import tempfile
from openerp.modules.module import load_information_from_description_file,\
get_module_path, MANIFEST
from openerp.tests.common import TransactionCase
from odoo.modules.module import load_information_from_description_file,\
get_module_path
from odoo.tests.common import TransactionCase
from ..hooks import _handle_rdepends_if_installed, _installed_modules from ..hooks import _handle_rdepends_if_installed, _installed_modules
MOCK_PATH = 'openerp.addons.base_manifest_extension.hooks'
MOCK_PATH = 'odoo.addons.base_manifest_extension.hooks'
class TestHooks(TransactionCase): class TestHooks(TransactionCase):
@ -40,7 +40,8 @@ class TestHooks(TransactionCase):
module_path = tempfile.mkdtemp(dir=os.path.join( module_path = tempfile.mkdtemp(dir=os.path.join(
get_module_path('base_manifest_extension'), 'static' get_module_path('base_manifest_extension'), 'static'
)) ))
with open(os.path.join(module_path, MANIFEST), 'w') as manifest:
manifest_path = os.path.join(module_path, '__manifest__.py')
with open(manifest_path, 'w') as manifest:
manifest.write(repr({ manifest.write(repr({
'depends_if_installed': [ 'depends_if_installed': [
'base_manifest_extension', 'base_manifest_extension',
@ -61,7 +62,7 @@ class TestHooks(TransactionCase):
result = _installed_modules(self.test_cr, self.test_rdepends) result = _installed_modules(self.test_cr, self.test_rdepends)
expected = self.test_rdepends[:2] expected = self.test_rdepends[:2]
self.assertEqual(result, expected)
self.assertItemsEqual(result, expected)
def test_installed_modules_empty_starting_list(self): def test_installed_modules_empty_starting_list(self):
"""It should safely handle being passed an empty module list""" """It should safely handle being passed an empty module list"""

Loading…
Cancel
Save