Move #memo tests to a folder and add examples
This commit is contained in:
parent
abd5a3f3cf
commit
a53442fdea
69
jubeatools/formats/jubeat_analyser/tests/memo/example1.py
Normal file
69
jubeatools/formats/jubeat_analyser/tests/memo/example1.py
Normal file
@ -0,0 +1,69 @@
|
||||
from jubeatools.song import TapNote, LongNote, NotePosition
|
||||
from fractions import Fraction
|
||||
|
||||
notes = {
|
||||
TapNote(time=Fraction(0, 1), position=NotePosition(x=0, y=0)),
|
||||
TapNote(time=Fraction(0, 1), position=NotePosition(x=0, y=1)),
|
||||
TapNote(time=Fraction(0, 1), position=NotePosition(x=0, y=3)),
|
||||
LongNote(
|
||||
time=Fraction(0, 1),
|
||||
position=NotePosition(x=1, y=0),
|
||||
duration=Fraction(1, 16),
|
||||
tail_tip=NotePosition(x=2, y=0),
|
||||
),
|
||||
TapNote(time=Fraction(0, 1), position=NotePosition(x=1, y=1)),
|
||||
LongNote(
|
||||
time=Fraction(0, 1),
|
||||
position=NotePosition(x=1, y=2),
|
||||
duration=Fraction(1, 3),
|
||||
tail_tip=NotePosition(x=2, y=2),
|
||||
),
|
||||
LongNote(
|
||||
time=Fraction(1, 8),
|
||||
position=NotePosition(x=0, y=3),
|
||||
duration=Fraction(1, 4),
|
||||
tail_tip=NotePosition(x=2, y=3),
|
||||
),
|
||||
TapNote(time=Fraction(1, 4), position=NotePosition(x=0, y=0)),
|
||||
TapNote(time=Fraction(5, 16), position=NotePosition(x=1, y=0)),
|
||||
LongNote(
|
||||
time=Fraction(1, 2),
|
||||
position=NotePosition(x=0, y=0),
|
||||
duration=Fraction(1, 16),
|
||||
tail_tip=NotePosition(x=1, y=0),
|
||||
),
|
||||
LongNote(
|
||||
time=Fraction(5, 8),
|
||||
position=NotePosition(x=0, y=3),
|
||||
duration=Fraction(1, 4),
|
||||
tail_tip=NotePosition(x=1, y=3),
|
||||
),
|
||||
TapNote(time=Fraction(13, 16), position=NotePosition(x=0, y=0)),
|
||||
LongNote(
|
||||
time=Fraction(17, 16),
|
||||
position=NotePosition(x=0, y=0),
|
||||
duration=Fraction(1, 4),
|
||||
tail_tip=NotePosition(x=1, y=0),
|
||||
),
|
||||
LongNote(
|
||||
time=Fraction(25, 16),
|
||||
position=NotePosition(x=0, y=0),
|
||||
duration=Fraction(1, 4),
|
||||
tail_tip=NotePosition(x=2, y=0),
|
||||
),
|
||||
TapNote(time=Fraction(33, 16), position=NotePosition(x=0, y=0)),
|
||||
TapNote(time=Fraction(57, 8), position=NotePosition(x=1, y=1)),
|
||||
TapNote(time=Fraction(59, 8), position=NotePosition(x=1, y=1)),
|
||||
TapNote(time=Fraction(61, 8), position=NotePosition(x=1, y=1)),
|
||||
TapNote(time=Fraction(63, 8), position=NotePosition(x=1, y=1)),
|
||||
TapNote(time=Fraction(79, 8), position=NotePosition(x=1, y=1)),
|
||||
TapNote(time=Fraction(187, 16), position=NotePosition(x=1, y=0)),
|
||||
TapNote(time=Fraction(191, 16), position=NotePosition(x=1, y=0)),
|
||||
LongNote(
|
||||
time=Fraction(97, 8),
|
||||
position=NotePosition(x=1, y=1),
|
||||
duration=Fraction(1, 4),
|
||||
tail_tip=NotePosition(x=2, y=1),
|
||||
),
|
||||
TapNote(time=Fraction(195, 16), position=NotePosition(x=1, y=0)),
|
||||
}
|
@ -1,9 +1,9 @@
|
||||
from decimal import Decimal
|
||||
from fractions import Fraction
|
||||
from pathlib import Path
|
||||
from typing import List, Union
|
||||
from typing import Set, Union
|
||||
|
||||
from hypothesis import given
|
||||
from hypothesis import given, example
|
||||
|
||||
from jubeatools.song import (
|
||||
BeatsTime,
|
||||
@ -18,13 +18,15 @@ from jubeatools.song import (
|
||||
)
|
||||
from jubeatools.testutils.strategies import NoteOption
|
||||
from jubeatools.testutils.strategies import notes as notes_strat
|
||||
from jubeatools.formats.jubeat_analyser.memo.dump import _dump_memo_chart
|
||||
from jubeatools.formats.jubeat_analyser.memo.load import MemoParser
|
||||
|
||||
from ..memo.dump import _dump_memo_chart
|
||||
from ..memo.load import MemoParser
|
||||
from . import example1
|
||||
|
||||
|
||||
@given(notes_strat(NoteOption.LONGS))
|
||||
def test_many_notes(notes: List[Union[TapNote, LongNote]]) -> None:
|
||||
@example(example1.notes)
|
||||
def test_many_notes(notes: Set[Union[TapNote, LongNote]]) -> None:
|
||||
timing = Timing(
|
||||
events=[BPMEvent(BeatsTime(0), Decimal(120))], beat_zero_offset=SecondsTime(0)
|
||||
)
|
Loading…
x
Reference in New Issue
Block a user