-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Trenton Holmes
committed
Oct 8, 2024
1 parent
9f8ecff
commit ff3836f
Showing
7 changed files
with
72 additions
and
37 deletions.
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
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 |
---|---|---|
@@ -1,24 +1,23 @@ | ||
from pathlib import Path | ||
|
||
import magic | ||
|
||
from tests.conftest import SAMPLE_DIR | ||
from tika_client.client import TikaClient | ||
|
||
|
||
class TestParseImageMetadata: | ||
def test_image_jpeg(self, tika_client: TikaClient): | ||
def test_image_jpeg(self, tika_client: TikaClient, sample_jpeg_file: Path): | ||
""" | ||
Test the handling of a JPEG file metadata retrieval | ||
""" | ||
test_file = SAMPLE_DIR / "sample.jpg" | ||
resp = tika_client.metadata.from_file(test_file, magic.from_file(str(test_file), mime=True)) | ||
resp = tika_client.metadata.from_file(sample_jpeg_file, magic.from_file(str(sample_jpeg_file), mime=True)) | ||
|
||
assert resp.type == "image/jpeg" | ||
|
||
def test_image_png(self, tika_client: TikaClient): | ||
def test_image_png(self, tika_client: TikaClient, sample_png_file: Path): | ||
""" | ||
Test the handling of a PNG file metadata retrieval | ||
""" | ||
test_file = SAMPLE_DIR / "sample.png" | ||
resp = tika_client.metadata.from_file(test_file, magic.from_file(str(test_file), mime=True)) | ||
resp = tika_client.metadata.from_file(sample_png_file, magic.from_file(str(sample_png_file), mime=True)) | ||
|
||
assert resp.type == "image/png" |
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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
import magic | ||
|
||
from tests.conftest import SAMPLE_DIR | ||
from tika_client.client import TikaClient | ||
|
||
|
||
|
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 |
---|---|---|
|
@@ -4,7 +4,6 @@ | |
|
||
import magic | ||
|
||
from tests.conftest import SAMPLE_DIR | ||
from tika_client.client import TikaClient | ||
|
||
|
||
|