From 0aca7e75d25ec42d7c097582a0ca963c705d949d Mon Sep 17 00:00:00 2001 From: Oleg Bulkin Date: Fri, 15 Sep 2017 17:19:21 -0700 Subject: [PATCH] [MIG] base_manifest_extension: Migrate to v10 * Rename manifest file and change all openerp references to odoo * Make minor test fixes --- .../{__openerp__.py => __manifest__.py} | 2 +- base_manifest_extension/hooks.py | 6 +++--- base_manifest_extension/tests/test_hooks.py | 13 +++++++------ 3 files changed, 11 insertions(+), 10 deletions(-) rename base_manifest_extension/{__openerp__.py => __manifest__.py} (94%) diff --git a/base_manifest_extension/__openerp__.py b/base_manifest_extension/__manifest__.py similarity index 94% rename from base_manifest_extension/__openerp__.py rename to base_manifest_extension/__manifest__.py index 892c18bd7..d73f9e6b2 100644 --- a/base_manifest_extension/__openerp__.py +++ b/base_manifest_extension/__manifest__.py @@ -5,7 +5,7 @@ { 'name': 'Module Manifest - Extra Options', - 'version': '9.0.1.0.0', + 'version': '10.0.1.0.0', 'website': 'https://github.com/OCA/server-tools', 'author': 'Therp BV, LasLabs, Odoo Community Association (OCA)', 'license': 'LGPL-3', diff --git a/base_manifest_extension/hooks.py b/base_manifest_extension/hooks.py index 2e0c4d12d..3be77df4d 100644 --- a/base_manifest_extension/hooks.py +++ b/base_manifest_extension/hooks.py @@ -5,9 +5,9 @@ import inspect 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 local = Local() diff --git a/base_manifest_extension/tests/test_hooks.py b/base_manifest_extension/tests/test_hooks.py index 3e06b8cab..d46eeab0e 100644 --- a/base_manifest_extension/tests/test_hooks.py +++ b/base_manifest_extension/tests/test_hooks.py @@ -6,12 +6,12 @@ from mock import Mock, patch import os 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 -MOCK_PATH = 'openerp.addons.base_manifest_extension.hooks' +MOCK_PATH = 'odoo.addons.base_manifest_extension.hooks' class TestHooks(TransactionCase): @@ -40,7 +40,8 @@ class TestHooks(TransactionCase): module_path = tempfile.mkdtemp(dir=os.path.join( 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({ 'depends_if_installed': [ 'base_manifest_extension', @@ -61,7 +62,7 @@ class TestHooks(TransactionCase): result = _installed_modules(self.test_cr, self.test_rdepends) expected = self.test_rdepends[:2] - self.assertEqual(result, expected) + self.assertItemsEqual(result, expected) def test_installed_modules_empty_starting_list(self): """It should safely handle being passed an empty module list"""