Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IIIF
backend
Commits
f0e1504e
Verified
Commit
f0e1504e
authored
Jan 18, 2023
by
David Beniamine
Browse files
Options
Downloads
Patches
Plain Diff
Working first test
parent
f1b5ff40
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Mirador_backend/tests/test_mirador_resource.py
+7
-9
7 additions, 9 deletions
Mirador_backend/tests/test_mirador_resource.py
Mirador_backend/tests/tester.py
+17
-0
17 additions, 0 deletions
Mirador_backend/tests/tester.py
with
24 additions
and
9 deletions
Mirador_backend/tests/test_mirador_resource.py
+
7
−
9
View file @
f0e1504e
import
unittest
import
json
import
json
from
Mirador_backend
import
app
from
Mirador_backend
.tests.tester
import
TestCase
class
MiradorResourceTest
(
unittest
.
TestCase
):
class
MiradorResourceTest
(
TestCase
):
def
setup
(
self
):
base
=
'
/mirador_resource
'
self
.
base
=
'
/mirador_resource
'
self
.
app
=
app
.
test_client
self
.
db
=
None
# Todo
def
testGet
(
self
):
def
testGet
(
self
):
# TODO payload
payload
=
json
.
dumps
({})
payload
=
json
.
dumps
({})
response
=
self
.
app
.
get
(
self
.
base
+
'
/1
'
,
headers
=
{
"
Content-Type
"
:
"
application/json
"
},
data
=
payload
)
response
=
self
.
client
.
get
(
self
.
base
+
'
/1
'
,
headers
=
{
"
Content-Type
"
:
"
application/json
"
},
data
=
payload
)
self
.
assertEqual
(
200
,
response
.
status_code
)
self
.
assertEqual
(
200
,
response
.
status_code
)
# TODO test actual behavior with fixture data
self
.
assertEqual
(
'
get
'
,
response
.
json
[
'
method
'
])
self
.
assertEqual
(
'
get
'
,
response
.
json
[
'
method
'
])
self
.
assertEqual
(
str
,
type
(
response
.
json
[
'
id
'
]))
self
.
assertEqual
(
int
,
type
(
response
.
json
[
'
id
'
]))
This diff is collapsed.
Click to expand it.
Mirador_backend/tests/tester.py
0 → 100644
+
17
−
0
View file @
f0e1504e
import
unittest
from
Mirador_backend.app
import
app
class
TestCase
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
base
=
'
/mirador_resource
'
self
.
app
=
app
app
.
testing
=
True
self
.
client
=
app
.
test_client
()
# TODO DB, FS and fixtures
self
.
db
=
None
def
tearDown
(
self
):
# TODO
pass
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment