Skip to content

Commit

Permalink
setup: remove python3.11 support (cchardet)
Browse files Browse the repository at this point in the history
* and fix tests
  • Loading branch information
utnapischtim committed Jul 25, 2023
1 parent d520526 commit 9bc8a23
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 100 deletions.
2 changes: 1 addition & 1 deletion invenio_moodle/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def visit_resourcetype(self, value: str, record: LOMMetadata) -> None:
"""Visit resourcetype."""
# https://skohub.io/dini-ag-kim/hcrt/heads/master/w3id.org/kim/hcrt/slide.en.html
learningresourcetype_by_resourcetype = {
"No selection": "other",
"no selection": "other",
"noselection": "other",
"presentationslide": "slide",
"exercise": "assessment",
Expand Down
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ classifiers =
Topic :: Software Development :: Libraries :: Python Modules
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11

[options]
include_package_data = True
Expand Down
123 changes: 27 additions & 96 deletions tests/data/lom_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,33 @@
}
}
},
"educational": {
"learningresourcetype": [
{
"source": {
"langstring": {
"#text": "https://w3id.org/kim/hcrt/scheme",
"lang": "x-none"
}
},
"id": "https://w3id.org/kim/hcrt/other",
"entry": [
{
"langstring": {
"#text": "Sonstiges",
"lang": "de"
}
},
{
"langstring": {
"#text": "Other",
"lang": "en"
}
}
]
}
]
},
"general": {
"language": [
"de"
Expand Down Expand Up @@ -297,102 +324,6 @@
"datetime": "2023"
}
}
},
{
"course": {
"identifier": [
{
"catalog": "teachcenter-course-id",
"entry": {
"langstring": {
"#text": "moodlecourse-475",
"lang": "x-none"
}
}
},
{
"catalog": "tugrazonline-id",
"entry": {
"langstring": {
"#text": "0",
"lang": "x-none"
}
}
}
],
"title": {
"langstring": {
"#text": "[INR02412UF] AK Technology Enhanced Learning (SS)",
"lang": "x-none"
}
},
"keyword": [
{
"langstring": {
"#text": "",
"lang": "x-none"
}
}
],
"description": [
{
"langstring": {
"#text": "",
"lang": "x-none"
}
}
],
"contribute": [
{
"role": {
"source": {
"langstring": {
"#text": "LOMv1.0",
"lang": "x-none"
}
},
"value": {
"langstring": {
"#text": "Unknown",
"lang": "x-none"
}
}
},
"entity": [
""
]
},
{
"role": {
"source": {
"langstring": {
"#text": "LOMv1.0",
"lang": "x-none"
}
},
"value": {
"langstring": {
"#text": "Author",
"lang": "x-none"
}
}
},
"entity": [
"Martin Ebner"
]
}
],
"language": [
""
],
"version": {
"langstring": {
"#text": "SS 2023",
"lang": "x-none"
},
"datetime": "2023"
}
}
}
]
}
Expand Down
8 changes: 6 additions & 2 deletions tests/test_convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

"""Module test convert."""

from invenio_records_lom.utils import LOMMetadata

from invenio_moodle.convert import convert_moodle_to_lom


Expand All @@ -15,6 +17,8 @@ def test_convert_moodle_to_lom(
expected_lom_metadata: dict,
) -> None:
"""Test convert_unit_metadata."""
metadata = convert_moodle_to_lom(minimal_record)
del minimal_record["courses"][1]

assert metadata.json == expected_lom_metadata
lom_metadata = LOMMetadata({}, overwritable=True)
convert_moodle_to_lom(minimal_record, lom_metadata)
assert lom_metadata.json == expected_lom_metadata

0 comments on commit 9bc8a23

Please sign in to comment.