Skip to content
Snippets Groups Projects
Verified Commit 7b23ae7b authored by Jesper Zedlitz's avatar Jesper Zedlitz
Browse files

tests for JPEG and PDF

parent dca021a7
Branches
Tags
1 merge request!1Update Formats, Dependencies, and Dockerfile Configuration
Pipeline #1400 passed
tests/data/image.jpeg

525 B

File added
import unittest
from formats.jpeg_format import is_valid
class TestJpegFormat(unittest.TestCase):
def test_is_valid__valid(self):
resource = {}
with open("tests/data/image.jpeg", "r") as file:
self.assertTrue(is_valid(resource, file))
def test_is_valid__invalid(self):
resource = {}
with open("tests/data/image.png", "r") as file:
self.assertFalse(is_valid(resource, file))
if __name__ == "__main__":
unittest.main()
import unittest
from formats.pdf_format import is_valid
class TestPdfFormat(unittest.TestCase):
def test_is_valid__valid(self):
resource = {}
with open("tests/data/valid.pdf", "r") as file:
self.assertTrue(is_valid(resource, file))
def test_is_valid__invalid(self):
resource = {}
with open("tests/data/image.png", "r") as file:
self.assertFalse(is_valid(resource, file))
if __name__ == "__main__":
unittest.main()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment