Exemplo n.º 1
0
 def test_Add(self):
     from niprov.jsonfile import JsonFile
     repo = JsonFile(self.dependencies)
     img1 = self.imageWithProvenance({'location': '1', 'foo': 'baz'})
     repo.all = Mock()
     repo.all.return_value = [img1]
     image = self.imageWithProvenance({'location': '2', 'foo': 'bar'})
     repo.add(image)
     self.serializer.serializeList.assert_called_with([img1, image])
     self.filesys.write.assert_called_with(repo.datafile,
                                           self.serializer.serializeList())
Exemplo n.º 2
0
 def test_Add(self):
     from niprov.jsonfile import JsonFile
     repo = JsonFile(self.dependencies)
     img1 = self.imageWithProvenance({'location':'1','foo':'baz'})
     repo.all = Mock()
     repo.all.return_value = [img1]
     image = self.imageWithProvenance({'location': '2','foo':'bar'})
     repo.add(image)
     self.serializer.serializeList.assert_called_with(
         [img1, image])
     self.filesys.write.assert_called_with(repo.datafile, 
         self.serializer.serializeList())
Exemplo n.º 3
0
 def test_Will_tell_PictureCache_to_persist_known_Snapshot(self):
     from niprov.jsonfile import JsonFile
     repo = JsonFile(self.dependencies)
     img = self.imageWithProvenance({'location': '1', 'foo': 'baz'})
     repo.add(img)
     self.pictureCache.saveToDisk.assert_called_with(for_=img)
Exemplo n.º 4
0
 def test_Will_tell_PictureCache_to_persist_known_Snapshot(self):
     from niprov.jsonfile import JsonFile
     repo = JsonFile(self.dependencies)
     img = self.imageWithProvenance({'location':'1','foo':'baz'})
     repo.add(img)
     self.pictureCache.saveToDisk.assert_called_with(for_=img)