Skip to content

Commit

Permalink
Merge 12b715c into c2ac96c
Browse files Browse the repository at this point in the history
  • Loading branch information
sbabayan committed Apr 10, 2019
2 parents c2ac96c + 12b715c commit e0c88b6
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 12 deletions.
2 changes: 1 addition & 1 deletion startup.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand Down
6 changes: 1 addition & 5 deletions tabpy-server/server_tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand Down
5 changes: 0 additions & 5 deletions tabpy-server/server_tests/test_pwd_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion tabpy-server/tabpy_server/app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'])))
Expand Down

0 comments on commit e0c88b6

Please sign in to comment.