diff options
| author | Adam Hupp <adam@hupp.org> | 2020-12-11 11:57:07 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-11 11:57:07 -0800 |
| commit | a96081edc65ddcf20599b3fa1ef72eb2c55f1055 (patch) | |
| tree | 05c80abbc80da3c96184999a33524fc9b069cabe /test | |
| parent | 35026a19d6ff2b1934999ec6fb9c1812e4d4b07e (diff) | |
| parent | ca14bfba7d1eeea543c9e00ea33d1487a49e68e0 (diff) | |
| download | python-magic-a96081edc65ddcf20599b3fa1ef72eb2c55f1055.tar.gz | |
Merge pull request #227 from psrok1/magic-descriptor
Added support for magic_descriptor routine
Diffstat (limited to 'test')
| -rwxr-xr-x | test/test.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/test.py b/test/test.py index eb5af89..3097e6e 100755 --- a/test/test.py +++ b/test/test.py @@ -56,6 +56,13 @@ class MagicTest(unittest.TestCase): self.assertEqual('application/pdf', magic.from_file(filename.encode('utf-8'), mime=True)) + def test_from_descriptor_str_and_bytes(self): + with open(os.path.join(self.TESTDATA_DIR, "test.pdf")) as f: + self.assertEqual('application/pdf', + magic.from_descriptor(f.fileno(), mime=True)) + self.assertEqual('application/pdf', + magic.from_descriptor(f.fileno(), mime=True)) + def test_from_buffer_str_and_bytes(self): m = magic.Magic(mime=True) |
