-
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #60 from sbidoul/install-wheel
Make sure that Odoo is correctly installed
- Loading branch information
Showing
3 changed files
with
36 additions
and
4 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
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 |
---|---|---|
|
@@ -2,12 +2,13 @@ | |
|
||
import os | ||
import shutil | ||
from pathlib import Path | ||
import subprocess | ||
import sys | ||
from pathlib import Path | ||
|
||
import pytest | ||
|
||
from .common import odoo_bin, odoo_version_info | ||
from .common import odoo_bin, make_addons_dir | ||
|
||
|
||
def test_odoo_bin_in_path(): | ||
|
@@ -44,3 +45,32 @@ def test_openerp_server_rc(): | |
|
||
def test_import_odoo(): | ||
subprocess.check_call(["python", "-c", "import odoo; odoo.addons.__path__"]) | ||
subprocess.check_call(["python", "-c", "import odoo.cli"]) | ||
|
||
|
||
def _target_python_version(): | ||
version = subprocess.check_output( | ||
["python", "-c", "import platform; print(platform.python_version())"], | ||
universal_newlines=True, | ||
) | ||
major, minor = version.split(".")[:2] | ||
return int(major), int(minor) | ||
|
||
|
||
@pytest.mark.skipif( | ||
_target_python_version() < (3, 7), reason="Whool requires python3.7 or higher" | ||
) | ||
def test_import_odoo_after_addon_install(): | ||
with make_addons_dir(["addon_success"]) as addons_dir: | ||
addon_dir = addons_dir / "addon_success" | ||
subprocess.check_call(["git", "init"], cwd=addon_dir) | ||
subprocess.check_call(["git", "add", "."], cwd=addon_dir) | ||
subprocess.check_call(["git", "config", "user.email", "..."], cwd=addon_dir) | ||
subprocess.check_call( | ||
["git", "config", "user.name", "[email protected]"], cwd=addon_dir | ||
) | ||
subprocess.check_call(["git", "commit", "-m", "..."], cwd=addon_dir) | ||
subprocess.check_call( | ||
["python", "-m", "pip", "install", addons_dir / "addon_success"] | ||
) | ||
subprocess.check_call(["python", "-c", "import odoo.cli"]) |