Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
python-libs
odoo-libs
odoo_launcher
Commits
a6797e4b
Commit
a6797e4b
authored
Aug 27, 2022
by
Alexis PASQUIER
Browse files
Fix unittest
parent
b5a4a90b
Pipeline
#81826
passed with stages
in 1 minute and 47 seconds
Changes
3
Pipelines
4
Hide whitespace changes
Inline
Side-by-side
odoo_launcher/config_section.py
View file @
a6797e4b
...
...
@@ -181,6 +181,9 @@ class DatabaseOdooConfigSection(OdooConfigSection):
self
.
filter
=
self
.
name
if
self
.
name
and
self
.
show
and
not
self
.
filter
:
self
.
filter
=
self
.
name
+
".*"
if
not
self
.
host
or
not
self
.
name
or
not
self
.
user
or
not
self
.
password
:
self
.
enable
=
False
return
self
def
_get_conn_mode
(
self
,
env_vars
):
...
...
@@ -212,9 +215,6 @@ class HttpOdooConfigSection(OdooConfigSection):
def
__init__
(
self
,
odoo_config_maker
:
OdooConfigABC
)
->
None
:
super
().
__init__
(
odoo_config_maker
)
self
.
enable
=
True
self
.
interface
=
None
self
.
port
=
None
self
.
longpolling_port
=
None
self
.
key_http
=
"http"
if
self
.
config_maker
.
odoo_version
>
10
else
"xmlrpc"
self
.
disable_dict
=
{
"--no-%s"
%
self
.
key_http
:
True
}
self
.
interface
=
"0.0.0.0"
...
...
tests/test_config_global.py
View file @
a6797e4b
...
...
@@ -10,18 +10,15 @@ class TestOdooConfig(unittest.TestCase):
config
=
OdooConfig
(
odoo_version
=
16
,
odoo_rc
=
"/tmp/odoo_rc.ini"
,
main_instance
=
True
)
config
.
load_registry
(
Registry
)
config
.
populate_all_section
(
env_vars
=
{
"REMOTE_DB"
:
str
(
False
)})
result
=
config
.
to_dict
()
print
(
result
)
expected
=
{
"--config"
:
"/tmp/odoo_rc.ini"
,
"--http-interface"
:
"0.0.0.0"
,
"--http-port"
:
8080
,
"--longpolling-port"
:
4040
,
"--unaccent"
:
False
,
"--test-enable"
:
False
,
"--config=/tmp/odoo_rc.ini"
,
"--http-interface=0.0.0.0"
,
"--http-port=8080"
,
"--longpolling-port=4040"
,
"--unaccent"
,
"--without-demo=all"
,
"--max-cron-threads=2"
,
"--load=base,web"
,
"--workers=1"
,
}
for
key
,
value
in
expected
.
items
():
self
.
assertIn
(
key
,
result
)
self
.
assertEqual
(
value
,
result
[
key
],
"key [%s] expected => %s got => %s"
%
(
key
,
value
,
result
.
get
(
key
)))
result
.
pop
(
key
)
self
.
assertFalse
(
result
)
self
.
assertSetEqual
(
expected
,
set
(
config
.
to_odoo_args
()))
tests/test_odoo_launcher.py
View file @
a6797e4b
...
...
@@ -179,13 +179,9 @@ class Test_WebLauncher(base_test.TestLauncherPatched):
self
.
assertListEqual
(
[
"/usr/bin/python3"
,
"/my/path/to/odoo/odoo-bin"
,
f
"--addons-path=
{
api
.
AbstractLauncher
.
server_path
}
"
,
"ndpserver"
,
"--config=/tmp/odoo_rc.ini"
,
],
launcher
.
normalize_args
(
config
),
config
.
to_odoo_args
(
),
)
def
test_WebLauncherDepends
(
self
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment