Exemple #1
0
 def test_png_bytes(self):
     with open(self.receipt_png, "rb") as fd:
         myfile = fd.read()
     content_type = get_content_type(myfile)
     self.assertEqual(content_type, "image/png")
Exemple #2
0
 def test_tiff_little_endian(self):
     with open(self.invoice_tiff, "rb") as fd:
         content_type = get_content_type(fd)
     self.assertEqual(content_type, "image/tiff")
Exemple #3
0
 def test_jpg_bytes(self):
     with open(self.form_jpg, "rb") as fd:
         myfile = fd.read()
     content_type = get_content_type(myfile)
     self.assertEqual(content_type, "image/jpeg")
Exemple #4
0
 def test_png(self):
     with open(self.receipt_png, "rb") as fd:
         content_type = get_content_type(fd)
     self.assertEqual(content_type, "image/png")
Exemple #5
0
 def test_pdf_bytes(self):
     with open(self.invoice_pdf, "rb") as fd:
         myfile = fd.read()
     content_type = get_content_type(myfile)
     self.assertEqual(content_type, "application/pdf")
Exemple #6
0
 def test_jpg(self):
     with open(self.form_jpg, "rb") as fd:
         content_type = get_content_type(fd)
     self.assertEqual(content_type, "image/jpeg")
 def test_bmp(self):
     content_type = get_content_type(b"\x42\x4D\x00\x00")
     assert content_type == "image/bmp"
 def test_jpg_bytes(self):
     with open(self.form_jpg, "rb") as fd:
         my_file = fd.read()
     content_type = get_content_type(my_file)
     assert content_type == "image/jpeg"
 def test_png(self):
     with open(self.receipt_png, "rb") as fd:
         content_type = get_content_type(fd)
     assert content_type == "image/png"
 def test_tiff_big_endian(self):
     content_type = get_content_type(b"\x4D\x4D\x00\x2A")
     assert content_type == "image/tiff"
 def test_jpg(self):
     with open(self.form_jpg, "rb") as fd:
         content_type = get_content_type(fd)
     assert content_type == "image/jpeg"
 def test_bmp(self):
     content_type = get_content_type(b"\x42\x4D\x00\x00")
     self.assertEqual(content_type, "image/bmp")
 def test_png_bytes(self):
     with open(self.receipt_png, "rb") as fd:
         my_file = fd.read()
     content_type = get_content_type(my_file)
     assert content_type == "image/png"
Exemple #14
0
 def test_tiff_little_endian_bytes(self):
     with open(self.invoice_tiff, "rb") as fd:
         myfile = fd.read()
     content_type = get_content_type(myfile)
     self.assertEqual(content_type, "image/tiff")
Exemple #15
0
 def test_pdf(self):
     with open(self.invoice_pdf, "rb") as fd:
         content_type = get_content_type(fd)
     self.assertEqual(content_type, "application/pdf")
Exemple #16
0
 def test_tiff_big_endian(self):
     content_type = get_content_type(b"\x4D\x4D\x00\x2A")
     self.assertEqual(content_type, "image/tiff")
 def test_pdf_bytes(self):
     with open(self.invoice_pdf, "rb") as fd:
         my_file = fd.read()
     content_type = get_content_type(my_file)
     assert content_type == "application/pdf"