Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
04191ea1
Unverified
Commit
04191ea1
authored
Sep 19, 2023
by
Lucain
Committed by
GitHub
Sep 19, 2023
Browse files
Fix gated repo tests (#26257)
* Fix gated repo tests * Apply suggestions from code review
parent
eb848997
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
tests/utils/test_hub_utils.py
tests/utils/test_hub_utils.py
+4
-4
No files found.
tests/utils/test_hub_utils.py
View file @
04191ea1
...
...
@@ -128,14 +128,14 @@ class GetFromCacheTests(unittest.TestCase):
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
)
# All files except README.md are protected on a gated repo.
cached_file
(
GATED_REPO
,
"gated_file.txt"
,
use_auth_token
=
False
)
@
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
)
# All files except README.md are protected on a gated repo.
has_file
(
GATED_REPO
,
"gated_file.txt"
,
use_auth_token
=
False
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment