Ejemplo n.º 1
0
 def test_negative(self):
     with open(join(self.datadir, 'textfile.jpg')) as image:
         buf = image.buffer.read()
     self.assertFalse(AllowedMime.validate(
         buf=buf,
         mimes=self.mimes,
     ))
Ejemplo n.º 2
0
 def test_negative(self):
     with open(join(self.datadir, 'textfile.jpg')) as image:
         buf = image.buffer.read()
     self.assertFalse(AllowedMime.validate(
         buf=buf,
         mimes=self.mimes,
     ))
Ejemplo n.º 3
0
 def test_positive(self):
     with open(join(self.datadir, 'validimage.jpg')) as image:
         buf = image.buffer.read()
     self.assertTrue(AllowedMime.validate(
         buf=buf,
         mimes=self.mimes,
     ))
Ejemplo n.º 4
0
 def test_positive(self):
     with open(join(self.datadir, 'validimage.jpg')) as image:
         buf = image.buffer.read()
     self.assertTrue(AllowedMime.validate(
         buf=buf,
         mimes=self.mimes,
     ))