Skip to content

Commit

Permalink
chore: bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanomunarini committed Dec 14, 2023
1 parent 293f8d5 commit a91c6dc
Show file tree
Hide file tree
Showing 4 changed files with 128 additions and 1 deletion.
5 changes: 5 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
Changelog
=========

v0.2.31
=======

- Merge and match versions (v0.2.28, v0.2.29 and v0.2.30)

v0.2.29
=======

Expand Down
2 changes: 1 addition & 1 deletion relaton/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.2.28'
__version__ = '0.2.31'
56 changes: 56 additions & 0 deletions relaton/tests/static/fixtures/iana/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
id: RFC1330
title:
- content: Recommendations for the Phase I Deployment of OSI Directory Services (X.500)
and OSI Message Handling Services (X.400) within the ESNET Community
format: text/plain
type: main
link:
- content: https://www.rfc-editor.org/info/rfc1330
type: src
type: standard
docid:
- id: RFC 1330
type: IETF
primary: true
- id: 10.17487/RFC1330
type: DOI
docnumber: RFC1330
date:
- type: published
value: 1992-05
contributor:
- organization:
name:
- content: ESCC X.500/X.400 Task Force
role:
- author
- organization:
name:
- content: ESnet Site Coordinating Comittee
role:
- author
- organization:
name:
- content: Energy Sciences Network
role:
- author
revdate: 1992-05
language:
- en
script:
- Latn
abstract:
- content: "<p>This RFC is a near verbatim copy of the whitepaper produced by the
ESnet Site Coordinating Committee's X.500/X.400 Task Force. This memo provides
information for the Internet community. It does not specify an Internet standard.</p>"
language:
- en
script:
- Latn
format: text/html
series:
- title:
content: RFC
format: text/plain
number: '1330'
fetched: '2022-09-01'
66 changes: 66 additions & 0 deletions relaton/tests/test_schema_validation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# type: ignore
import os
from unittest import TestCase

import yaml
from lxml import etree

from relaton.models import BibliographicItem
from relaton.serializers.bibxml import serialize


class DataSourceValidationTestCase(TestCase):
# fixtures = ["iana/*.yaml"]

def setUp(self):
module_dir = os.path.dirname(__file__)
file_path = os.path.join(module_dir, "static/schemas/v3.xsd")
self.xmlschema = etree.XMLSchema(file=file_path)

def _load_yaml_data(self, ):
pass

def _validate_yaml_data(self, url):
import requests
r = requests.get(url)
yaml_object = yaml.safe_load(r.content)
bibitem = BibliographicItem(**yaml_object)
serialized_data = serialize(bibitem)

self.xmlschema.assertValid(serialized_data)

def test_validate_rfcs_data(self):
url = "https://raw.githubusercontent.com/ietf-tools/relaton-data-rfcs/main/data/RFC0001.yaml"
self._validate_yaml_data(url)

def test_validate_misc_data(self):
url = "https://raw.githubusercontent.com/ietf-tools/relaton-data-misc/main/data/reference.ANSI.T1-102.1987.yaml"
self._validate_yaml_data(url)

def test_validate_internet_drafts_data(self):
url = "https://raw.githubusercontent.com/ietf-tools/relaton-data-ids/main/data/draft--pale-email-00.yaml"
self._validate_yaml_data(url)

def test_validate_w3c_data(self):
url = "https://raw.githubusercontent.com/ietf-tools/relaton-data-w3c/main/data/2dcontext.yaml"
self._validate_yaml_data(url)

def test_validate_threegpp_data(self):
url = "https://raw.githubusercontent.com/ietf-tools/relaton-data-3gpp/main/data/TR_00.01U_UMTS_3.0.0.yaml"
self._validate_yaml_data(url)

def test_validate_ieee_data(self):
url = "https://raw.githubusercontent.com/ietf-tools/relaton-data-ieee/main/data/AIEE_11-1943.yaml"
self._validate_yaml_data(url)

def test_validate_iana_data(self):
url = "https://raw.githubusercontent.com/ietf-tools/relaton-data-iana/main/data/_6lowpan-parameters.yaml"
self._validate_yaml_data(url)

def test_validate_rfcsubseries_data(self):
url = "https://raw.githubusercontent.com/ietf-tools/relaton-data-rfcsubseries/main/data/BCP0003.yaml"
self._validate_yaml_data(url)

def test_validate_nist_data(self):
url = "https://raw.githubusercontent.com/ietf-tools/relaton-data-nist/main/data/NBS_BH_1.yaml"
self._validate_yaml_data(url)

0 comments on commit a91c6dc

Please sign in to comment.