-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
293f8d5
commit a91c6dc
Showing
4 changed files
with
128 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = '0.2.28' | ||
__version__ = '0.2.31' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |