Skip to content

Commit

Permalink
Skip test_login until Robin is back
Browse files Browse the repository at this point in the history
  • Loading branch information
aversey committed Jul 15, 2024
1 parent 24414d6 commit 4e09c81
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions python/tests/hopsworks/test_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
from unittest import TestCase, mock
from contextlib import contextmanager
import hopsworks
import getpass
import os
import uuid
import tempfile
import importlib
import os
import shutil
import tempfile
import uuid
from contextlib import contextmanager
from datetime import date
from unittest import TestCase, mock, skipIf

import hopsworks
from hopsworks.client import exceptions
from hopsworks.project import Project

Expand Down Expand Up @@ -63,7 +65,6 @@ def tearDown(self):
hopsworks.logout()

def _check_api_key_existence(self):

path = hopsworks._get_cached_api_key_path()

api_key_name = ".hw_api_key"
Expand All @@ -87,6 +88,7 @@ def _check_api_key_existence(self):
path == temp_api_key_path,
)

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

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

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

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

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

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

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

Expand All @@ -177,6 +183,7 @@ def test_login_use_cwd_api_key(self):
assert in_home is False
assert in_tmp is False

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

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

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

@skipIf(date.today() <= date(2024, 7, 22), "Robin is on vacation.")
def test_login_newline_in_api_key(self):
try:
imaginaryApiKey = "ImaginaryApiKey\n"
Expand Down

0 comments on commit 4e09c81

Please sign in to comment.