Browse Source

[FIX] module_auto_update: Add .pyo sample file (#1205)

Without this patch, if your tests are run under a `PYTHONOPTIMIZE=2` precompiled environment, they'd fail with this error because a new `.pyo` file would be created.:

    FAIL: test_basic (openerp.addons.module_auto_update.tests.test_addon_hash.TestAddonHash)
    Traceback (most recent call last):
    `   File "/opt/odoo/auto/addons/module_auto_update/tests/test_addon_hash.py", line 41, in test_basic
    `     'static/src/some.js',
    ` AssertionError: Lists differ: ['README.rst', 'data/f1.xml', ... != ['README.rst', 'data/f1.xml', ...
    `
    ` First differing element 13:
    ` models/stuff.pyo
    ` static/src/some.js
    `
    ` First list contains 1 additional elements.
    ` First extra element 14:
    ` static/src/some.js
    `
    `   ['README.rst',
    `    'data/f1.xml',
    `    'data/f2.xml',
    `    'i18n/en.po',
    `    'i18n/en_US.po',
    `    'i18n/fr.po',
    `    'i18n/fr_BE.po',
    `    'i18n/test.pot',
    `    'i18n_extra/en.po',
    `    'i18n_extra/fr.po',
    `    'i18n_extra/nl_NL.po',
    `    'models/stuff.py',
    `    'models/stuff.pyc',
    ` -  'models/stuff.pyo',
    `    'static/src/some.js']
    Ran 3 tests in 0.005s
    FAILED

With this patch, the `.pyo` file is included, so tests will pass anywhere.
pull/1207/head
Jairo Llopis 7 years ago
committed by Laurent Mignon (ACSONE)
parent
commit
0a41e8e91d
  1. 2
      module_auto_update/__manifest__.py
  2. BIN
      module_auto_update/tests/sample_module/models/stuff.pyo
  3. 1
      module_auto_update/tests/test_addon_hash.py

2
module_auto_update/__manifest__.py

@ -5,7 +5,7 @@
{ {
'name': 'Module Auto Update', 'name': 'Module Auto Update',
'summary': 'Automatically update Odoo modules', 'summary': 'Automatically update Odoo modules',
'version': '10.0.2.0.0',
'version': '10.0.2.0.1',
'category': 'Extra Tools', 'category': 'Extra Tools',
'website': 'https://github.com/OCA/server-tools', 'website': 'https://github.com/OCA/server-tools',
'author': 'LasLabs, ' 'author': 'LasLabs, '

BIN
module_auto_update/tests/sample_module/models/stuff.pyo

1
module_auto_update/tests/test_addon_hash.py

@ -38,6 +38,7 @@ class TestAddonHash(unittest.TestCase):
'i18n_extra/nl_NL.po', 'i18n_extra/nl_NL.po',
'models/stuff.py', 'models/stuff.py',
'models/stuff.pyc', 'models/stuff.pyc',
'models/stuff.pyo',
'static/src/some.js', 'static/src/some.js',
]) ])

Loading…
Cancel
Save