forked from beetbox/mediafile
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Ingo Fischer
committed
Jan 6, 2020
1 parent
384784c
commit 2f88190
Showing
2 changed files
with
66 additions
and
1 deletion.
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
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 |
---|---|---|
|
@@ -755,6 +755,37 @@ def test_unknown_apic_type(self): | |
mediafile = self._mediafile_fixture('image_unknown_type') | ||
self.assertEqual(mediafile.images[0].type, ImageType.other) | ||
|
||
def test_write_single_popm(self): | ||
mediafile = self._mediafile_fixture('empty') | ||
test_email = '[email protected]' | ||
mediafile.popm = { | ||
test_email: {'rating': 1, 'count': 1} | ||
} | ||
mediafile.save() | ||
self.assertEqual(mediafile.popm, { | ||
test_email: {'rating': 1, 'count': 1} | ||
}) | ||
|
||
def test_write_popm_without_count(self): | ||
mediafile = self._mediafile_fixture('empty') | ||
test_email = '[email protected]' | ||
mediafile.popm = {test_email: {'rating': 1}} | ||
mediafile.save() | ||
self.assertEqual(mediafile.popm, { | ||
test_email: {'rating': 1, 'count': 0} | ||
}) | ||
|
||
def test_write_multiple_popm(self): | ||
mediafile = self._mediafile_fixture('full') | ||
mediafile.popm = {'[email protected]': {'rating': 1, 'count': 1}, | ||
'[email protected]': {'rating': 2, 'count': 2}} | ||
mediafile.save() | ||
|
||
self.assertEqual(mediafile.popm, { | ||
'[email protected]': {'rating': 1, 'count': 1}, | ||
'[email protected]': {'rating': 2, 'count': 2}, | ||
}) | ||
|
||
|
||
class MP4Test(ReadWriteTestBase, PartialTestMixin, | ||
ImageStructureTestMixin, unittest.TestCase): | ||
|
@@ -975,7 +1006,7 @@ def test_properties_from_readable_fields(self): | |
|
||
def test_known_fields(self): | ||
fields = list(ReadWriteTestBase.tag_fields) | ||
fields.extend(('encoder', 'images', 'genres', 'albumtype')) | ||
fields.extend(('encoder', 'images', 'genres', 'albumtype', 'popm')) | ||
assertCountEqual(self, MediaFile.fields(), fields) | ||
|
||
def test_fields_in_readable_fields(self): | ||
|