diff --git a/startup.cmd b/startup.cmd index 386f70f3..4aba054c 100755 --- a/startup.cmd +++ b/startup.cmd @@ -49,7 +49,7 @@ ECHO Parsing parameters... SET PYTHONPATH=%TABPY_ROOT%\tabpy-server;%TABPY_ROOT%\tabpy-tools;%PYTHONPATH% SET STARTUP_CMD=python tabpy-server\tabpy_server\tabpy.py IF [%1] NEQ [] ( - ECHO Using config file at %TABPY_ROOT%\tabpy-server\tabpy_server\%1 + ECHO Using config file at %1 SET STARTUP_CMD=%STARTUP_CMD% --config=%1 ) diff --git a/tabpy-server/server_tests/test_config.py b/tabpy-server/server_tests/test_config.py index 9e8194e4..7c4d8533 100644 --- a/tabpy-server/server_tests/test_config.py +++ b/tabpy-server/server_tests/test_config.py @@ -35,7 +35,7 @@ def test_no_config_file(self, mock_os, mock_file_exists, getenv_calls = [call('TABPY_PORT', 9004), call('TABPY_QUERY_OBJECT_PATH', '/tmp/query_objects'), - call('TABPY_STATE_PATH', './')] + call('TABPY_STATE_PATH', './tabpy-server/tabpy_server')] mock_os.getenv.assert_has_calls(getenv_calls, any_order=True) self.assertEqual(len(mock_file_exists.mock_calls), 2) self.assertEqual(len(mock_psws.mock_calls), 1) @@ -113,15 +113,11 @@ def raise_attribute_error(): def __init__(self, *args, **kwargs): super(TestTransferProtocolValidation, self).__init__(*args, **kwargs) self.fp = None - self.cwd = os.getcwd() - self.tabpy_cwd = os.path.join(self.cwd, 'tabpy-server', 'tabpy_server') def setUp(self): - os.chdir(self.tabpy_cwd) self.fp = NamedTemporaryFile(mode='w+t', delete=False) def tearDown(self): - os.chdir(self.cwd) os.remove(self.fp.name) self.fp = None diff --git a/tabpy-server/server_tests/test_pwd_file.py b/tabpy-server/server_tests/test_pwd_file.py index 57c59307..c431cae8 100755 --- a/tabpy-server/server_tests/test_pwd_file.py +++ b/tabpy-server/server_tests/test_pwd_file.py @@ -13,17 +13,12 @@ class TestPasswordFile(unittest.TestCase): def setUp(self): - self.cwd = pathlib.Path.cwd() - self.tabpy_cwd = self.cwd / 'tabpy-server' / 'tabpy_server' - os.chdir(self.tabpy_cwd) - self.config_file = NamedTemporaryFile(mode='w', delete=False) self.config_file.close() self.pwd_file = NamedTemporaryFile(mode='w', delete=False) self.pwd_file.close() def tearDown(self): - os.chdir(self.cwd) os.remove(self.config_file.name) self.config_file = None os.remove(self.pwd_file.name) diff --git a/tabpy-server/tabpy_server/app/app.py b/tabpy-server/tabpy_server/app/app.py index ef97ce43..ab09297e 100644 --- a/tabpy-server/tabpy_server/app/app.py +++ b/tabpy-server/tabpy_server/app/app.py @@ -208,7 +208,8 @@ def set_parameter(settings_key, # if state.ini does not exist try and create it - remove # last dependence on batch/shell script set_parameter('state_file_path', ConfigParameters.TABPY_STATE_PATH, - default_val='./', check_env_var=True) + default_val='./tabpy-server/tabpy_server', + check_env_var=True) self.settings['state_file_path'] = os.path.realpath( os.path.normpath( os.path.expanduser(self.settings['state_file_path'])))