From 27ab87a7a2b5f6788961e9360cc05ae5029e6239 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Wed, 22 Sep 2021 14:55:44 +0300 Subject: [PATCH] add test_api_config_test --- tests/test_pub1c-rest.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/tests/test_pub1c-rest.py b/tests/test_pub1c-rest.py index 14461ed..7516271 100644 --- a/tests/test_pub1c-rest.py +++ b/tests/test_pub1c-rest.py @@ -14,6 +14,9 @@ def temp_config(tmpdir) -> str: apache_config = tmpdir.join('apache.cfg') apache_config.write('#start\n') flagfile = tmpdir.join('apache_restart') + platform_path = tmpdir.mkdir('platform') + ws_module = 'wsap24.so' + platform_path.join(ws_module).write('\0') with open(configfile, 'w') as f: yaml.dump({ @@ -21,8 +24,8 @@ def temp_config(tmpdir) -> str: 'vrd_path': str(vrd_path), 'dir_path': str(dir_path), 'url_base': '/1c', - 'platform_path': '/opt/1cv8/x86_64/current', - 'ws_module': 'wsap24.so', + 'platform_path': str(platform_path), + 'ws_module': ws_module, 'vrd_params': { 'debug': None, 'server_addr': 'localhost' @@ -72,3 +75,15 @@ def test_api_restart_flag(client): response = client.get(endpoint) assert 200 == response.status_code + +def test_api_config_test(client): + response = client.get('/api/v1/config-test') + data = response.get_json() + assert data == { + 'is_apache_cfg_valid': True, + 'is_vrd_path_valid': True, + 'is_dir_path_valid': True, + 'is_url_base_valid': True, + 'is_module_valid': True, + } +