1
0
mirror of synced 2024-12-11 06:26:00 +01:00

Merge pull request #15 from Stepland/malody-extra-keys

[malody] allow unknown keys in input
This commit is contained in:
Stepland 2021-05-28 01:59:06 +02:00 committed by GitHub
commit a4f8499aaf
8 changed files with 2715 additions and 1 deletions

View File

@ -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 # v1.2.0
## Added ## Added
- [malody] 🎉 initial malody support ! - [malody] 🎉 initial malody support !

View File

@ -1,4 +1,4 @@
from hypothesis import given, reproduce_failure from hypothesis import given
from jubeatools import song from jubeatools import song
from jubeatools.formats import Format from jubeatools.formats import Format

View File

@ -3,6 +3,7 @@ from decimal import Decimal
from enum import Enum from enum import Enum
from typing import List, Optional, Tuple, Union from typing import List, Optional, Tuple, Union
from marshmallow import EXCLUDE
from marshmallow.validate import Range from marshmallow.validate import Range
from marshmallow_dataclass import NewType, class_schema from marshmallow_dataclass import NewType, class_schema
@ -10,6 +11,7 @@ from marshmallow_dataclass import NewType, class_schema
class Ordered: class Ordered:
class Meta: class Meta:
ordered = True ordered = True
unknown = EXCLUDE
@dataclass @dataclass

File diff suppressed because it is too large Load Diff

View 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"""

View 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")