Skip to content

Commit 70a611d

Browse files
committed
Skip test_login until Robin is back
1 parent 5d198d4 commit 70a611d

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

python/tests/hopsworks/test_login.py

+16-7
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,17 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
from unittest import TestCase, mock
17-
from contextlib import contextmanager
18-
import hopsworks
1916
import getpass
20-
import os
21-
import uuid
22-
import tempfile
2317
import importlib
18+
import os
2419
import shutil
20+
import tempfile
21+
import uuid
22+
from contextlib import contextmanager
23+
from datetime import date
24+
from unittest import TestCase, mock, skipIf
25+
26+
import hopsworks
2527
from hopsworks.client import exceptions
2628
from hopsworks.project import Project
2729

@@ -63,7 +65,6 @@ def tearDown(self):
6365
hopsworks.logout()
6466

6567
def _check_api_key_existence(self):
66-
6768
path = hopsworks._get_cached_api_key_path()
6869

6970
api_key_name = ".hw_api_key"
@@ -87,6 +88,7 @@ def _check_api_key_existence(self):
8788
path == temp_api_key_path,
8889
)
8990

91+
@skipIf(date.today() <= date(2024, 7, 22), "Robin is on vacation.")
9092
def test_login_api_key_as_input(self):
9193
# Should accept api key as input from command line
9294

@@ -106,6 +108,7 @@ def test_login_api_key_as_input(self):
106108
assert in_home is True and os.path.exists(path)
107109
assert in_tmp is False
108110

111+
@skipIf(date.today() <= date(2024, 7, 22), "Robin is on vacation.")
109112
def test_login_api_key_as_argument(self):
110113
# Should accept api key as argument
111114
path, in_cwd, in_home, in_tmp = self._check_api_key_existence()
@@ -123,6 +126,7 @@ def test_login_api_key_as_argument(self):
123126
assert in_home is True and not os.path.exists(path)
124127
assert in_tmp is False
125128

129+
@skipIf(date.today() <= date(2024, 7, 22), "Robin is on vacation.")
126130
def test_login_cmd_input_incorrect(self):
127131
# Should fail to login with incorrect API key
128132

@@ -136,6 +140,7 @@ def test_login_cmd_input_incorrect(self):
136140
with input({"hidden": "incorrect_api_key"}):
137141
hopsworks.login()
138142

143+
@skipIf(date.today() <= date(2024, 7, 22), "Robin is on vacation.")
139144
def test_login_fallback_to_tmp(self):
140145
# Should fall back to storing api key in tmp folder if home is not write and executable for user
141146
os.chmod(self.home_dir, 0o400)
@@ -155,6 +160,7 @@ def test_login_fallback_to_tmp(self):
155160
assert in_home is False
156161
assert in_tmp is True and os.path.exists(path)
157162

163+
@skipIf(date.today() <= date(2024, 7, 22), "Robin is on vacation.")
158164
def test_login_use_cwd_api_key(self):
159165
# Should use API key in cwd if exists
160166

@@ -177,6 +183,7 @@ def test_login_use_cwd_api_key(self):
177183
assert in_home is False
178184
assert in_tmp is False
179185

186+
@skipIf(date.today() <= date(2024, 7, 22), "Robin is on vacation.")
180187
def test_login_use_home_api_key(self):
181188
# Should use API key in home if exists
182189

@@ -202,6 +209,7 @@ def test_login_use_home_api_key(self):
202209
assert in_home is True and os.path.exists(path)
203210
assert in_tmp is False
204211

212+
@skipIf(date.today() <= date(2024, 7, 22), "Robin is on vacation.")
205213
def test_login_api_key_as_environ(self):
206214
# Should accept api key as environmet variable
207215
try:
@@ -226,6 +234,7 @@ def test_login_api_key_as_environ(self):
226234
finally:
227235
del os.environ["HOPSWORKS_API_KEY"]
228236

237+
@skipIf(date.today() <= date(2024, 7, 22), "Robin is on vacation.")
229238
def test_login_newline_in_api_key(self):
230239
try:
231240
imaginaryApiKey = "ImaginaryApiKey\n"

0 commit comments

Comments
 (0)