Merge pull request #15 from Stepland/malody-extra-keys
[malody] allow unknown keys in input
This commit is contained in:
commit
a4f8499aaf
@ -1,3 +1,8 @@
|
||||
# v1.2.1
|
||||
## Fixed
|
||||
- [malody] Parsing a file with keys that are unused for conversion
|
||||
(like `meta.mode_ext` or `extra`) would fire errors, not anymore !
|
||||
|
||||
# v1.2.0
|
||||
## Added
|
||||
- [malody] 🎉 initial malody support !
|
||||
|
@ -1,4 +1,4 @@
|
||||
from hypothesis import given, reproduce_failure
|
||||
from hypothesis import given
|
||||
|
||||
from jubeatools import song
|
||||
from jubeatools.formats import Format
|
||||
|
@ -3,6 +3,7 @@ from decimal import Decimal
|
||||
from enum import Enum
|
||||
from typing import List, Optional, Tuple, Union
|
||||
|
||||
from marshmallow import EXCLUDE
|
||||
from marshmallow.validate import Range
|
||||
from marshmallow_dataclass import NewType, class_schema
|
||||
|
||||
@ -10,6 +11,7 @@ from marshmallow_dataclass import NewType, class_schema
|
||||
class Ordered:
|
||||
class Meta:
|
||||
ordered = True
|
||||
unknown = EXCLUDE
|
||||
|
||||
|
||||
@dataclass
|
||||
|
0
jubeatools/formats/malody/tests/__init__.py
Normal file
0
jubeatools/formats/malody/tests/__init__.py
Normal file
2686
jubeatools/formats/malody/tests/data/1533908574.mc
Normal file
2686
jubeatools/formats/malody/tests/data/1533908574.mc
Normal file
File diff suppressed because it is too large
Load Diff
2
jubeatools/formats/malody/tests/data/__init__.py
Normal file
2
jubeatools/formats/malody/tests/data/__init__.py
Normal file
@ -0,0 +1,2 @@
|
||||
"""This file is here so the test code can use importlib as a portable way to
|
||||
open test data in this folder"""
|
19
jubeatools/formats/malody/tests/test_examples.py
Normal file
19
jubeatools/formats/malody/tests/test_examples.py
Normal file
@ -0,0 +1,19 @@
|
||||
from importlib import resources
|
||||
|
||||
from jubeatools.formats import LOADERS
|
||||
from jubeatools.formats.guess import guess_format
|
||||
|
||||
from . import data
|
||||
|
||||
|
||||
def try_to_load(example_file: str) -> None:
|
||||
with resources.path(data, example_file) as p:
|
||||
format_ = guess_format(p)
|
||||
loader = LOADERS[format_]
|
||||
_ = loader(p)
|
||||
|
||||
|
||||
def test_MilK() -> None:
|
||||
"""An actual malody chart will have may keys unspecified in the marshmallow
|
||||
schema, these should be ignored"""
|
||||
try_to_load("1533908574.mc")
|
Loading…
Reference in New Issue
Block a user