Commit 9e8f35f8 authored by Alexis PASQUIER's avatar Alexis PASQUIER
Browse files

Test key

 Using addons-installer>=1.2.2
parent 314c298e
Pipeline #74576 failed with stages
in 2 minutes and 28 seconds
......@@ -19,7 +19,7 @@ python_requires = >=2.7, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*
include_package_data = True
packages = odoo_launcher
install_requires =
addons-installer>=1.2.1
addons-installer>=1.2.2
maintenance-server>=1.2.1
typing==3.10.0.0;python_version<='3'
enum34==1.1.10;python_version<='3'
......
......@@ -8,47 +8,49 @@ class TestOdooConfig(unittest.TestCase):
def test_0(self):
config = OdooConfig(env_vars={"REMOTE_DB": str(False)}, main_instance=True)
result = config.to_dict()
self.assertDictEqual(
{
"--config": None,
"--update": "",
"--init": "",
"--stop-after-init": False,
"--save": False,
"--addons-path": [],
"--workers": 1,
"--max-cron-threads": 0,
"--limit-request": None,
"--limit-time-cpu": None,
"--limit-time-real": None,
"--limit-memory-hard": None,
"--limit-memory-soft": None,
"--osv-memory-count-limit": None,
"--osv-memory-age-limit": None,
"--xmlrpc-interface": "0.0.0.0",
"--xmlrpc-port": 8080,
"--longpolling-port": 4040,
"--db_host": None,
"--db_port": None,
"--db_user": None,
"--db_password": None,
"--database": None,
"--no-database-list": True,
"--db_maxconn": 2,
"--db-filter": None,
"--load": ["base", "web", "odoo_filestore_s3", "odoo_session_redis"],
"--unaccent": True,
"--test-enable": False,
"--without-demo": False,
"--logfile": None,
"--log-handler": None,
"--log-request": False,
"--log-response": False,
"--log-web": False,
"--log-sql": False,
"--log-db": False,
"--log-db-level": None,
"--log-level": None,
},
result,
)
expected = {
"--config": None,
"--update": "",
"--init": "",
"--stop-after-init": False,
"--save": False,
"--addons-path": [],
"--workers": 1,
"--max-cron-threads": 0,
"--limit-request": None,
"--limit-time-cpu": None,
"--limit-time-real": None,
"--limit-memory-hard": None,
"--limit-memory-soft": None,
"--osv-memory-count-limit": None,
"--osv-memory-age-limit": None,
"--xmlrpc-interface": "0.0.0.0",
"--xmlrpc-port": 8080,
"--longpolling-port": 4040,
"--db_host": None,
"--db_port": None,
"--db_user": None,
"--db_password": None,
"--database": None,
"--no-database-list": True,
"--db_maxconn": 2,
"--db-filter": None,
"--load": ["base", "web"],
"--unaccent": True,
"--test-enable": False,
"--without-demo": False,
"--logfile": None,
"--log-handler": None,
"--log-request": False,
"--log-response": False,
"--log-web": False,
"--log-sql": False,
"--log-db": False,
"--log-db-level": None,
"--log-level": None,
}
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)
......@@ -72,7 +72,7 @@ class TestOdooLauncher(unittest.TestCase):
result = config.to_odoo_args()
print(result)
self.assertEqual("--unaccent", result.pop())
self.assertEqual("--load=base,web,queue_job,odoo_filestore_s3,odoo_session_redis", result.pop())
self.assertEqual("--load=base,web,queue_job,odoo_filestore_s3", result.pop())
self.assertEqual("--db-filter=test_db", result.pop())
self.assertEqual("--db_maxconn=9", result.pop())
self.assertEqual("--no-database-list", result.pop())
......@@ -81,7 +81,9 @@ class TestOdooLauncher(unittest.TestCase):
self.assertEqual("--db_user=odoo", result.pop())
self.assertEqual("--db_port=5432", result.pop())
self.assertEqual("--db_host=localhost", result.pop())
self.assertEqual("--no-http", result.pop())
self.assertEqual("--longpolling-port=8072", result.pop())
self.assertEqual("--http-port=8080", result.pop())
self.assertEqual("--http-interface=0.0.0.0", result.pop())
self.assertEqual("--max-cron-threads=2", result.pop())
self.assertEqual("--workers=4", result.pop())
......@@ -118,7 +120,7 @@ class TestOdooLauncher(unittest.TestCase):
result = config.to_odoo_args()
self.assertEqual(7, len(result))
self.assertEqual("--unaccent", result.pop())
self.assertEqual("--load=base,web,odoo_filestore_s3,odoo_session_redis", result.pop())
self.assertEqual("--load=base,web,odoo_filestore_s3", result.pop())
self.assertEqual("--no-http", result.pop())
self.assertEqual("--stop-after-init", result.pop())
self.assertEqual("--init=my_erp", result.pop())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment