Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add uninstalling capacity #17

Merged
merged 7 commits into from
Apr 18, 2017
Merged

Add uninstalling capacity #17

merged 7 commits into from
Apr 18, 2017

Conversation

damdam-s
Copy link
Contributor

No description provided.

tasks.py Outdated
@@ -48,10 +48,10 @@ def tests_createdb(ctx, version):
db = dbname(version)
print('Installing database {}'.format(db))
if is_below_odoo_10(version):
ctx.run('odoo.py -d {} --workers=0 --log-level=critical '
ctx.run('odoo.py -d {} --workers=0 --log-level=critical -i lunch '
Copy link
Contributor Author

@damdam-s damdam-s Apr 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@guewen I did this to be able to test the uninstall of this module.
If there is a way to to it better, I'm open 😄

[('name', '=', 'lunch')]).button_immediate_install()
try:
uninstall(ctx, [])
except AnthemError:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could use pytest.raises:

with pytest.raises(AnthemError) as excinfo:
    uninstall(ctx, [])
excinfo.match(r'Cannot uninstall modules.*')

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok thanks. I will do it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@damdam-s however I goofed in the error message, should be 'You have to provide a list of module.*'

def test_uninstall_1():
with anthem.cli.Context(None, anthem.cli.Options(test_mode=True)) as ctx:
ctx.env['ir.module.module'].search(
[('name', '=', 'lunch')]).button_immediate_install()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it required to install the lunch addon in this test?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hum, I have to install at least a non-core module to test its uninstallation later

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW we can install another one but I found it was the less heavy to load

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this test you don't test the uninstallation of lunch but the call to uninstall with an empty list which is expected to fail. So having lunch installed or not does not make any difference.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course. My bad 😄

@damdam-s
Copy link
Contributor Author

@guewen green !
I didn't know how you would like to handle this functionnality (in anthem or in marabunta with a special section) but I needed it for a customer so ...

No problem if you want to to it elsewhere or in another way

Copy link
Contributor

@guewen guewen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't know how you would like to handle this functionnality (in anthem or in marabunta with a special section) but I needed it for a customer so ...

That's perfect. Marabunta can not handle it since there is no option in odoo.py to uninstall a module so anthem is the right place.

Thanks!

@guewen guewen merged commit a670a46 into camptocamp:master Apr 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants