Skip to content

test/test_mediafile.py::OpusTest::test_read_audio_properties fails with mutagen 1.48.1 #109

Description

@jaimeMF

On the builds for the openSUSE Tumbleweed package we have started to get an error on this test with the following message:

[   16s] =================================== FAILURES ===================================
[   16s] _____________________ OpusTest.test_read_audio_properties ______________________
[   16s] 
[   16s] self = <test.test_mediafile.OpusTest testMethod=test_read_audio_properties>
[   16s] 
[   16s]     def test_read_audio_properties(self):
[   16s]         mediafile = self._mediafile_fixture("full")
[   16s]         for key, value in self.audio_properties.items():
[   16s]             if isinstance(value, float):
[   16s]                 self.assertAlmostEqual(getattr(mediafile, key), value, delta=0.1)
[   16s]             else:
[   16s] >               self.assertEqual(getattr(mediafile, key), value)
[   16s] E               AssertionError: 52392 != 66792
[   16s] 
[   16s] test/test_mediafile.py:455: AssertionError
[   16s] =========================== short test summary info ============================
[   16s] FAILED test/test_mediafile.py::OpusTest::test_read_audio_properties - AssertionError: 52392 != 66792
[   16s] ============== 1 failed, 480 passed, 104 subtests passed in 1.30s ==============

On openSUSE We are using the version 1.48.1 of mutagen, which since version 1.48 provides the bitrate ( quodlibet/mutagen#704 ) and from my reading of the mediagen code it is being used instead of the one calculated by mutagen based on the file size.

I am going to modify the openSUSE package with the following patch:

Index: mediafile-0.17.0/test/test_mediafile.py
===================================================================
--- mediafile-0.17.0.orig/test/test_mediafile.py
+++ mediafile-0.17.0/test/test_mediafile.py
@@ -987,7 +987,7 @@ class OpusTest(ReadWriteTestBase, unitte
     extension = "opus"
     audio_properties = {
         "length": 1.0,
-        "bitrate": 66792,
+        "bitrate": 52392,
         "bitrate_mode": "",
         "encoder_info": "",
         "encoder_settings": "",

Feel free to use it or if you think it should be fixed on mutage I can open a bug there.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions