Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix gated repo tests #26257

Merged
merged 2 commits into from
Sep 19, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions tests/utils/test_hub_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,12 @@ def test_get_file_from_repo_local(self):

self.assertIsNone(get_file_from_repo(tmp_dir, "b.txt"))

@unittest.skip("Test is broken, fix me Wauplain!")
def test_get_file_gated_repo(self):
"""Test download file from a gated repo fails with correct message when not authenticated."""
with self.assertRaisesRegex(EnvironmentError, "You are trying to access a gated repo."):
cached_file(GATED_REPO, README_FILE, use_auth_token=False)
cached_file(GATED_REPO, "gated_file.txt", use_auth_token=False)
Wauplin marked this conversation as resolved.
Show resolved Hide resolved

@unittest.skip("Test is broken, fix me Wauplain!")
def test_has_file_gated_repo(self):
"""Test check file existence from a gated repo fails with correct message when not authenticated."""
with self.assertRaisesRegex(EnvironmentError, "is a gated repository"):
has_file(GATED_REPO, README_FILE, use_auth_token=False)
has_file(GATED_REPO, "gated_file.txt", use_auth_token=False)
Wauplin marked this conversation as resolved.
Show resolved Hide resolved