Ejemplo n.º 1
0
 def test_file_type(self):
     self.assertEquals(FileProperties.file_type('foo.png'), 'image')
     self.assertEquals(FileProperties.file_type(None), 'other')
     self.assertEquals(FileProperties.file_type('foo.unknown'), 'other')
     self.assertEquals(
         FileProperties.file_type('foo.unknown', 'image/jpeg'),
         'image'
     )
Ejemplo n.º 2
0
 def test_mime_type(self):
     self.assertEquals(FileProperties.mime_type('foo.png'), 'image/png')
     self.assertEquals(FileProperties.mime_type('foo.unknown'), None)
Ejemplo n.º 3
0
 def test_mime_type(self):
     self.assertEquals(FileProperties.mime_type('foo.png'), 'image/png')
     self.assertEquals(FileProperties.mime_type('foo.unknown'), None)
Ejemplo n.º 4
0
 def test_file_type(self):
     self.assertEquals(FileProperties.file_type('foo.png'), 'image')
     self.assertEquals(FileProperties.file_type(None), 'other')
     self.assertEquals(FileProperties.file_type('foo.unknown'), 'other')
     self.assertEquals(
         FileProperties.file_type('foo.unknown', 'image/jpeg'), 'image')