mirror of
https://github.com/iluvcapra/wavinfo.git
synced 2025-12-31 08:50:41 +00:00
Fixed a bug in the cues to_dict method
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import unittest
|
||||
import wavinfo
|
||||
|
||||
import glob
|
||||
|
||||
class TestWalk(unittest.TestCase):
|
||||
def test_walk_metadata(self):
|
||||
@@ -20,6 +21,17 @@ class TestWalk(unittest.TestCase):
|
||||
|
||||
self.assertTrue(tested_data and tested_format)
|
||||
|
||||
def test_walk_all(self):
|
||||
for file in glob.glob('tests/test_files/**/*.wav'):
|
||||
info = wavinfo.WavInfoReader(file)
|
||||
|
||||
try:
|
||||
for _, _, _ in info.walk():
|
||||
pass
|
||||
except:
|
||||
self.fail(f"Failed to walk metadata in file {file}")
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
@@ -247,10 +247,10 @@ class WavCuesReader:
|
||||
if r.name == cue_ident), None)
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
return dict(cues=[c.__dict__ for c in self.cues],
|
||||
labels=[l.__dict__ for l in self.labels],
|
||||
ranges=[r.__dict__ for r in self.ranges],
|
||||
notes=[n.__dict__ for n in self.notes])
|
||||
return dict(cues=[c._asdict() for c in self.cues],
|
||||
labels=[l._asdict() for l in self.labels],
|
||||
ranges=[r._asdict() for r in self.ranges],
|
||||
notes=[n._asdict() for n in self.notes])
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user