@@ -82,8 +82,8 @@ def test_login_experiment_ephemeral_token(self):
8282 content_type = 'application/json' , status = 200 )
8383
8484 # Login without updating the token and without persistence
85- if os .path .exists ('/tmp/.polyaxon/.authtoken' ):
86- os .remove ('/tmp/.polyaxon/.authtoken' )
85+ if os .path .exists (settings . TMP_AUTH_TOKEN_PATH ):
86+ os .remove (settings . TMP_AUTH_TOKEN_PATH )
8787 assert self .api_config .token == 'token'
8888 assert token == self .api_handler .login_experiment_ephemeral_token (
8989 username = 'user' ,
@@ -93,11 +93,11 @@ def test_login_experiment_ephemeral_token(self):
9393 set_token = False ,
9494 persist_token = False )
9595 assert self .api_config .token == 'token'
96- assert os .path .exists ('/tmp/.polyaxon/.authtoken' ) is False
96+ assert os .path .exists (settings . TMP_AUTH_TOKEN_PATH ) is False
9797
9898 # Login and update the token and persistence
99- if os .path .exists ('/tmp/.polyaxon/.authtoken' ):
100- os .remove ('/tmp/.polyaxon/.authtoken' )
99+ if os .path .exists (settings . TMP_AUTH_TOKEN_PATH ):
100+ os .remove (settings . TMP_AUTH_TOKEN_PATH )
101101 assert self .api_config .token == 'token'
102102 assert token == self .api_handler .login_experiment_ephemeral_token (
103103 username = 'user' ,
@@ -107,13 +107,13 @@ def test_login_experiment_ephemeral_token(self):
107107 set_token = True ,
108108 persist_token = True )
109109 assert self .api_config .token == token
110- assert os .path .exists ('/tmp/.polyaxon/.authtoken' ) is True
110+ assert os .path .exists (settings . TMP_AUTH_TOKEN_PATH ) is True
111111
112112 # Login remove ephemeral token from env var and settings
113113 os .environ [settings .SECRET_EPHEMERAL_TOKEN_KEY ] = 'value'
114114 settings .SECRET_EPHEMERAL_TOKEN = 'eph_token' # noqa
115- if os .path .exists ('/tmp/.polyaxon/.authtoken' ):
116- os .remove ('/tmp/.polyaxon/.authtoken' )
115+ if os .path .exists (settings . TMP_AUTH_TOKEN_PATH ):
116+ os .remove (settings . TMP_AUTH_TOKEN_PATH )
117117 assert self .api_config .token == token
118118 assert os .environ .get (settings .SECRET_EPHEMERAL_TOKEN_KEY ) == 'value'
119119 assert settings .SECRET_EPHEMERAL_TOKEN == 'eph_token'
@@ -125,7 +125,7 @@ def test_login_experiment_ephemeral_token(self):
125125 set_token = True ,
126126 persist_token = True )
127127 assert self .api_config .token == token
128- assert os .path .exists ('/tmp/.polyaxon/.authtoken' ) is True
128+ assert os .path .exists (settings . TMP_AUTH_TOKEN_PATH ) is True
129129 assert os .environ .get (settings .SECRET_EPHEMERAL_TOKEN_KEY ) is None
130130 assert not hasattr (settings , 'SECRET_EPHEMERAL_TOKEN' )
131131
0 commit comments