run black on codebase

This commit is contained in:
2023-02-05 16:22:01 +01:00
parent 4d74186df8
commit 3d7fe73569
10 changed files with 362 additions and 251 deletions

View File

@ -1,6 +1,7 @@
from ziffers import scale
import pytest
@pytest.mark.parametrize(
"name,expected",
[
@ -14,11 +15,37 @@ import pytest
def test_notenames(name: str, expected: int):
assert scale.note_to_midi(name) == expected
@pytest.mark.parametrize(
"pcs,expected",
[
(list(range(-9,10)), [45, 47, 48, 50, 52, 53, 55, 57, 59, 60, 62, 64, 65, 67, 69, 71, 72, 74, 76]),
(
list(range(-9, 10)),
[
45,
47,
48,
50,
52,
53,
55,
57,
59,
60,
62,
64,
65,
67,
69,
71,
72,
74,
76,
],
),
],
)
def test_note_to_midi(pcs: str, expected: int):
assert [scale.note_from_pc(root=60, pitch_class=val, intervals="Ionian") for val in pcs] == expected
assert [
scale.note_from_pc(root=60, pitch_class=val, intervals="Ionian") for val in pcs
] == expected