Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
swh-web-client
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jérémy Bobbio (Lunar)
swh-web-client
Commits
0f8452d7
Commit
0f8452d7
authored
4 years ago
by
Stefano Zacchiroli
Browse files
Options
Downloads
Patches
Plain Diff
tests: also test type-specific getters
parent
064e9445
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
swh/web/client/tests/test_web_api_client.py
+8
-0
8 additions, 0 deletions
swh/web/client/tests/test_web_api_client.py
with
8 additions
and
0 deletions
swh/web/client/tests/test_web_api_client.py
+
8
−
0
View file @
0f8452d7
...
...
@@ -19,6 +19,8 @@ def test_get_content(web_api_client, web_api_mock):
assert
obj
[
"
checksums
"
][
"
sha1
"
]
==
\
"
dc2830a9e72f23c1dfebef4413003221baa5fb62
"
assert
obj
==
web_api_client
.
content
(
pid
)
def
test_get_directory
(
web_api_client
,
web_api_mock
):
pid
=
parse_pid
(
"
swh:1:dir:977fc4b98c0e85816348cebd3b12026407c368b6
"
)
...
...
@@ -33,6 +35,8 @@ def test_get_directory(web_api_client, web_api_mock):
assert
dir_entry
[
"
name
"
]
==
"
.bzrignore
"
assert
dir_entry
[
"
length
"
]
==
582
assert
obj
==
web_api_client
.
directory
(
pid
)
def
test_get_release
(
web_api_client
,
web_api_mock
):
pid
=
parse_pid
(
"
swh:1:rel:b9db10d00835e9a43e2eebef2db1d04d4ae82342
"
)
...
...
@@ -48,6 +52,8 @@ def test_get_release(web_api_client, web_api_mock):
"
swh:1:rev:e005cb773c769436709ca6a1d625dc784dbc1636
"
)
assert
not
obj
[
"
synthetic
"
]
assert
obj
==
web_api_client
.
release
(
pid
)
def
test_get_revision
(
web_api_client
,
web_api_mock
):
pid
=
parse_pid
(
"
swh:1:rev:aafb16d69fd30ff58afdd69036a26047f3aebdc6
"
)
...
...
@@ -69,6 +75,8 @@ def test_get_revision(web_api_client, web_api_mock):
assert
obj
[
"
parents
"
][
1
][
"
id
"
]
==
parse_pid
(
"
swh:1:rev:37fc9e08d0c4b71807a4f1ecb06112e78d91c283
"
)
assert
obj
==
web_api_client
.
revision
(
pid
)
def
test_get_snapshot
(
web_api_client
,
web_api_mock
):
# small snapshot, the one from Web API doc
...
...
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