Skip to content

Commit

Permalink
fix: turn demo into tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vberlier committed Apr 10, 2022
1 parent 009f4a9 commit 837aef2
Show file tree
Hide file tree
Showing 19 changed files with 6,899 additions and 1 deletion.
187 changes: 186 additions & 1 deletion poetry.lock

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ python = "^3.8"
black = "^22.3.0"
isort = "^5.10.1"
python-semantic-release = "^7.27.1"
pytest = "^7.1.1"
pytest-insta = "^0.1.11"

[tool.black]
target-version = ["py38"]
Expand Down
Empty file added tests/__init__.py
Empty file.
13 changes: 13 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from pathlib import Path

from pytest_insta import Fmt


class FmtNbs(Fmt[bytes]):
extension = ".nbs"

def load(self, path: Path) -> bytes:
return path.read_bytes()

def dump(self, path: Path, value: bytes):
path.write_bytes(value)
Binary file added tests/resources/compat_demo_song.nbs
Binary file not shown.
Binary file added tests/resources/compat_old_demo_song.nbs
Binary file not shown.
Binary file added tests/resources/megalovania.nbs
Binary file not shown.
Binary file added tests/resources/nyan_cat.nbs
Binary file not shown.
Binary file added tests/resources/the_grounds_colour_is_yellow.nbs
Binary file not shown.
Binary file added tests/resources/turkish_march.nbs
Binary file not shown.
Binary file added tests/snapshots/song__create__new.nbs
Binary file not shown.
Binary file added tests/snapshots/song__create__old.nbs
Binary file not shown.
57 changes: 57 additions & 0 deletions tests/snapshots/song__notes_compat_demo_song_nbs__0.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
f.header.song_length = 287
f.header.description = 'This song is use for testing purposes'
len(f.notes) = 76
len(f.layers) = 27
len(f.instruments) = 0
4: [41]
6: [39]
8: [44]
11: [37]
14: [41]
17: [44, 41]
26: [56]
29: [35]
32: [53]
35: [44, 39]
47: [33]
53: [44, 37, 39]
59: [40]
65: [35, 42]
71: [44, 39, 40]
80: [39]
83: [37]
89: [44, 41, 41]
101: [35]
107: [44, 39]
119: [33]
125: [44, 37]
137: [35]
143: [44, 39]
148: [41]
150: [39]
152: [44]
155: [37]
158: [41]
161: [44, 41]
170: [56]
173: [35]
176: [53]
179: [44, 39]
191: [33]
197: [44, 37, 44]
203: [46]
209: [35, 47]
215: [44, 39, 46]
224: [42]
227: [37]
233: [44, 41, 44]
245: [35]
251: [44, 39]
256: [51]
258: [52]
260: [56]
263: [33]
266: [49]
269: [44, 37]
281: [35]
287: [44, 39]
57 changes: 57 additions & 0 deletions tests/snapshots/song__notes_compat_old_demo_song_nbs__0.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
f.header.song_length = 287
f.header.description = 'This song is use for testing purposes'
len(f.notes) = 76
len(f.layers) = 23
len(f.instruments) = 0
4: [41]
6: [39]
8: [44]
11: [37]
14: [41]
17: [44, 41]
26: [56]
29: [35]
32: [53]
35: [44, 39]
47: [33]
53: [44, 37, 39]
59: [40]
65: [35, 42]
71: [44, 39, 40]
80: [39]
83: [37]
89: [44, 41, 41]
101: [35]
107: [44, 39]
119: [33]
125: [44, 37]
137: [35]
143: [44, 39]
148: [41]
150: [39]
152: [44]
155: [37]
158: [41]
161: [44, 41]
170: [56]
173: [35]
176: [53]
179: [44, 39]
191: [33]
197: [44, 37, 44]
203: [46]
209: [35, 47]
215: [44, 39, 46]
224: [42]
227: [37]
233: [44, 41, 44]
245: [35]
251: [44, 39]
256: [51]
258: [52]
260: [56]
263: [33]
266: [49]
269: [44, 37]
281: [35]
287: [44, 39]
Loading

0 comments on commit 837aef2

Please sign in to comment.