How to use the puremagic.from_stream function in puremagic

To help you get started, we’ve selected a few puremagic examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cdgriffith / puremagic / test / test_common_extensions.py View on Github external
def test_stream(self):
        """Stream identification """
        ext = puremagic.from_stream(BytesIO(self.mp4magic))
        self.assertEqual(self.expect_ext, ext)
        self.assertRaises(ValueError, puremagic.from_stream, BytesIO(b""))
github cdgriffith / puremagic / test / test_common_extensions.py View on Github external
def test_stream(self):
        """Stream identification """
        ext = puremagic.from_stream(BytesIO(self.mp4magic))
        self.assertEqual(self.expect_ext, ext)
        self.assertRaises(ValueError, puremagic.from_stream, BytesIO(b""))