-
Notifications
You must be signed in to change notification settings - Fork 28
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
Conversation
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 ' |
There was a problem hiding this comment.
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 😄
tests/test_lyrics_uninstaller.py
Outdated
[('name', '=', 'lunch')]).button_immediate_install() | ||
try: | ||
uninstall(ctx, []) | ||
except AnthemError: |
There was a problem hiding this comment.
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.*')
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.*'
tests/test_lyrics_uninstaller.py
Outdated
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() |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course. My bad 😄
@guewen green ! No problem if you want to to it elsewhere or in another way |
There was a problem hiding this 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!
No description provided.