You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
1.2 KiB

  1. # -*- coding: utf-8 -*-
  2. # © 2017 Therp BV <http://therp.nl>
  3. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  4. import os
  5. import tempfile
  6. from openerp.tests.common import TransactionCase
  7. from openerp.modules.module import load_information_from_description_file,\
  8. get_module_path, MANIFEST
  9. class TestBaseManifestExtension(TransactionCase):
  10. def test_base_manifest_extension(self):
  11. # write a test manifest
  12. module_path = tempfile.mkdtemp(dir=os.path.join(
  13. get_module_path('base_manifest_extension'), 'static'
  14. ))
  15. with open(os.path.join(module_path, MANIFEST), 'w') as manifest:
  16. manifest.write(repr({
  17. 'depends_if_installed': [
  18. 'base_manifest_extension',
  19. 'not installed',
  20. ],
  21. }))
  22. # parse it
  23. parsed = load_information_from_description_file(
  24. # this name won't really be used, but avoids a warning
  25. 'base', mod_path=module_path,
  26. )
  27. self.assertIn('base_manifest_extension', parsed['depends'])
  28. self.assertNotIn('not installed', parsed['depends'])
  29. self.assertNotIn('depends_if_installed', parsed)