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
452dd0e4
Commit
452dd0e4
authored
Apr 30, 2020
by
Julien Chaumond
Browse files
[ci] Align test_hf_api.py with API change
parent
7f9193ef
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
tests/test_hf_api.py
tests/test_hf_api.py
+4
-4
No files found.
tests/test_hf_api.py
View file @
452dd0e4
...
@@ -28,11 +28,11 @@ USER = "__DUMMY_TRANSFORMERS_USER__"
...
@@ -28,11 +28,11 @@ USER = "__DUMMY_TRANSFORMERS_USER__"
PASS
=
"__DUMMY_TRANSFORMERS_PASS__"
PASS
=
"__DUMMY_TRANSFORMERS_PASS__"
FILES
=
[
FILES
=
[
(
(
"Test-{}.txt"
.
format
(
int
(
time
.
time
())),
"
nested/
Test-{}.txt"
.
format
(
int
(
time
.
time
())),
os
.
path
.
join
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)),
"fixtures/input.txt"
),
os
.
path
.
join
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)),
"fixtures/input.txt"
),
),
),
(
(
"yoyo {}.txt"
.
format
(
int
(
time
.
time
())),
# space is intentional
"
nested/
yoyo {}.txt"
.
format
(
int
(
time
.
time
())),
# space is intentional
os
.
path
.
join
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)),
"fixtures/empty.txt"
),
os
.
path
.
join
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)),
"fixtures/empty.txt"
),
),
),
]
]
...
@@ -73,10 +73,10 @@ class HfApiEndpointsTest(HfApiCommonTest):
...
@@ -73,10 +73,10 @@ class HfApiEndpointsTest(HfApiCommonTest):
def
test_presign_invalid_org
(
self
):
def
test_presign_invalid_org
(
self
):
with
self
.
assertRaises
(
HTTPError
):
with
self
.
assertRaises
(
HTTPError
):
_
=
self
.
_api
.
presign
(
token
=
self
.
_token
,
filename
=
"fake_org.txt"
,
organization
=
"fake"
)
_
=
self
.
_api
.
presign
(
token
=
self
.
_token
,
filename
=
"
nested/
fake_org.txt"
,
organization
=
"fake"
)
def
test_presign_valid_org
(
self
):
def
test_presign_valid_org
(
self
):
urls
=
self
.
_api
.
presign
(
token
=
self
.
_token
,
filename
=
"valid_org.txt"
,
organization
=
"valid_org"
)
urls
=
self
.
_api
.
presign
(
token
=
self
.
_token
,
filename
=
"
nested/
valid_org.txt"
,
organization
=
"valid_org"
)
self
.
assertIsInstance
(
urls
,
PresignedUrl
)
self
.
assertIsInstance
(
urls
,
PresignedUrl
)
def
test_presign
(
self
):
def
test_presign
(
self
):
...
...
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