Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
swh-model
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
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
Renaud Boyer
swh-model
Commits
710fb424
Commit
710fb424
authored
4 years ago
by
vlorentz
Browse files
Options
Downloads
Patches
Plain Diff
Add test checking SWHID_QUALIFIERS matches the attributes of QualifiedSWHID.
parent
7dead5df
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/model/tests/test_identifiers.py
+15
-0
15 additions, 0 deletions
swh/model/tests/test_identifiers.py
with
15 additions
and
0 deletions
swh/model/tests/test_identifiers.py
+
15
−
0
View file @
710fb424
...
...
@@ -9,6 +9,7 @@ import itertools
from
typing
import
Dict
import
unittest
import
attr
import
pytest
from
swh.model
import
hashutil
,
identifiers
...
...
@@ -21,6 +22,7 @@ from swh.model.identifiers import (
REVISION
,
SNAPSHOT
,
SWHID
,
SWHID_QUALIFIERS
,
CoreSWHID
,
ExtendedObjectType
,
ExtendedSWHID
,
...
...
@@ -1534,6 +1536,19 @@ def test_QualifiedSWHID_parse_qualifiers(string, parsed):
assert
str
(
parsed
)
==
string
def
test_QualifiedSWHID_attributes
():
"""
Checks the set of QualifiedSWHID attributes match the SWHID_QUALIFIERS
constant.
"""
assert
set
(
attr
.
fields_dict
(
QualifiedSWHID
))
==
{
"
namespace
"
,
"
scheme_version
"
,
"
object_type
"
,
"
object_id
"
,
*
SWHID_QUALIFIERS
,
}
@pytest.mark.parametrize
(
"
ns,version,type,id
"
,
[
...
...
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