コード例 #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
ファイル: test_pictures.py プロジェクト: ilogue/niprov
 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
ファイル: test_pictures.py プロジェクト: ilogue/niprov
 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'))