Skip to content
Snippets Groups Projects
Commit 710fb424 authored by vlorentz's avatar vlorentz
Browse files

Add test checking SWHID_QUALIFIERS matches the attributes of QualifiedSWHID.

parent 7dead5df
No related branches found
No related tags found
No related merge requests found
......@@ -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",
[
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment