Пример #1
0
 def test_Stored_picture_can_be_retrieved_as_bytes(self):
     from niprov.pictures import PictureCache
     myImg = Mock()
     myImg.provenance = {'id': '007'}
     pictures = PictureCache(sentinel.dependencies)
     newPicture = pictures.new()
     newPicture.write('/x10/x05/x5f')
     pictures.keep(newPicture, for_=myImg)
     outBytes = pictures.getBytes(for_=myImg)
     self.assertEqual('/x10/x05/x5f', outBytes)
Пример #2
0
 def test_Stored_picture_can_be_retrieved_as_bytes(self):
     from niprov.pictures import PictureCache
     myImg = Mock()
     myImg.provenance = {'id':'007'}
     pictures = PictureCache(sentinel.dependencies)
     newPicture = pictures.new()
     newPicture.write('/x10/x05/x5f')
     pictures.keep(newPicture, for_=myImg)
     outBytes = pictures.getBytes(for_=myImg)
     self.assertEqual('/x10/x05/x5f', outBytes)
Пример #3
0
 def test_Provides_new_picture_file_handle(self):
     from niprov.pictures import PictureCache
     pictures = PictureCache(sentinel.dependencies)
     newPicture = pictures.new()
     self.assertTrue(hasattr(newPicture, 'write'))
Пример #4
0
 def test_Provides_new_picture_file_handle(self):
     from niprov.pictures import PictureCache
     pictures = PictureCache(sentinel.dependencies)
     newPicture = pictures.new()
     self.assertTrue(hasattr(newPicture, 'write'))