Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Arkindex
Backend
Merge requests
!1113
Something went wrong on our end
Prevent calls to the Transkribus API in unit tests
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Prevent calls to the Transkribus API in unit tests
missing-transkribus-mock
into
master
Overview
1
Commits
1
Pipelines
0
Changes
1
Merged
Erwan Rouchet
requested to merge
missing-transkribus-mock
into
master
4 years ago
Overview
1
Commits
1
Pipelines
0
Changes
1
Expand
Closes
#479 (closed)
Edited
4 years ago
by
Erwan Rouchet
0
0
Merge request reports
Viewing commit
1ef4ec3a
Show latest version
1 file
+
4
−
1
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
1ef4ec3a
Prevent calls to the Transkribus API in unit tests
· 1ef4ec3a
Erwan Rouchet
authored
4 years ago
arkindex/dataimport/tests/test_transkribus_import.py
+
4
−
1
Options
@@ -47,7 +47,10 @@ class TestTranskribusImport(FixtureAPITestCase):
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_400_BAD_REQUEST
)
self
.
assertEqual
(
response
.
json
(),
{
"
__all__
"
:
[
"
You have not register your transkribus email
"
]})
def
test_arkindex_has_not_access
(
self
):
@patch
(
"
transkribus.TranskribusAPI.list_user_collection
"
)
def
test_arkindex_has_not_access
(
self
,
mock_transkribus
):
# Not a mistake: Transkribus client raises `Exception` directly when it runs out of retries
mock_transkribus
.
side_effect
=
Exception
(
"
401 Unauthorized
"
)
self
.
client
.
force_login
(
self
.
user
)
response
=
self
.
client
.
post
(
reverse
(
"
api:import-transkribus
"
),
{
"
collection_id
"
:
"
12345
"
,
Loading