-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve coverage and fix bug in tests
Bugfixes: Odoo tests split to prevent improperly reloading odoo.. The bug is caused by Odoo: odoo/odoo@d0ee861 The odoo code loaded by release is older while the version loaded with git would be newer. For some reasons, odoo wouldn't properly reload and tests would fail by running tests using addons of a newer version of odoo with an older core of odoo without the proper imports of dispatch_rpc
- Loading branch information
Showing
20 changed files
with
539 additions
and
206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,5 @@ | |
odoo_env, | ||
change_test_dir, | ||
ignore_warnings, | ||
runner | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,8 @@ | |
@click.group() | ||
def gen(): | ||
pass | ||
|
||
|
||
@gen.command() | ||
def info(): | ||
print("Install more modules like odoo-tools-rest") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,7 @@ | |
"packaging", | ||
"lxml", | ||
"docutils", | ||
"distro", | ||
"polib", | ||
"six>=1.12.0", | ||
"cryptography", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import os | ||
import pytest | ||
from pathlib import Path | ||
from mock import patch | ||
from odoo_tools.api.context import Context | ||
|
||
|
||
def test_context_default_odoorc(tmp_path): | ||
new_env = { | ||
"HOME": str(tmp_path) | ||
} | ||
|
||
with patch.dict(os.environ, new_env, clear=True): | ||
ctx = Context() | ||
assert ctx.default_odoorc() == Path.cwd() / 'odoo.cfg' | ||
|
||
new_env = { | ||
"HOME": str(tmp_path), | ||
} | ||
|
||
with patch.dict(os.environ, new_env, clear=True): | ||
odoo_rc = tmp_path / '.odoorc' | ||
with odoo_rc.open('w') as fout: | ||
fout.write('') | ||
|
||
ctx = Context() | ||
assert ctx.default_odoorc() == odoo_rc | ||
|
||
ctx = Context() | ||
assert ctx.default_odoorc() == Path.cwd() / 'odoo.cfg' | ||
assert ctx.odoo_rc == Path.cwd() / 'odoo.cfg' |
Oops, something went wrong.