-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
57 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
from unittest import TestCase | ||
from glob import glob | ||
|
||
import wavinfo | ||
|
||
class TestCue(TestCase): | ||
def setUp(self) -> None: | ||
self.test_files = glob("tests/test_files/cue_chunks/*.wav") | ||
return super().setUp() | ||
|
||
def test_encoding_fallback(self): | ||
file = "tests/test_files/cue_chunks/izotoperx_cues_test.wav" | ||
w = wavinfo.WavInfoReader(file, info_encoding='utf-8') | ||
expected = ("Лорем ипсум долор сит амет, тимеам вивендум хас ет, " | ||
"цу адолесценс дефинитионес еам.") | ||
|
||
note = [n for n in w.cues.notes if n.name == 3] | ||
self.assertEqual(len(note), 1) | ||
self.assertEqual(note[0].text, expected) | ||
|
||
def test_label(self): | ||
file = "tests/test_files/cue_chunks/izotoperx_cues_test.wav" | ||
w = wavinfo.WavInfoReader(file) | ||
|
||
self.assertIsNotNone(w.cues) | ||
|
||
self.assertEqual(len(w.cues.labels), 3) | ||
for label in w.cues.labels: | ||
if label.name == 1: | ||
self.assertEqual(label.text, "Marker 1") | ||
elif label.name == 2: | ||
self.assertEqual(label.text, "Marker 2") | ||
elif label.name == 3: | ||
self.assertEqual(label.text, "Marker 3") | ||
else: | ||
self.fail(f"Encountered unexpected label id {label.name}") | ||
|
||
|
||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters