Exemplo n.º 1
0
 def test_byId(self):
     from niprov.jsonfile import JsonFile
     repo = JsonFile(self.dependencies)
     img1 = self.imageWithProvenance({'id': '1'})
     img2 = self.imageWithProvenance({'id': '2'})
     img3 = self.imageWithProvenance({'id': '3'})
     repo.all = Mock()
     repo.all.return_value = [img1, img2, img3]
     out = repo.byId('2')
     self.assertEqual(img2, out)
Exemplo n.º 2
0
 def test_byId(self):
     from niprov.jsonfile import JsonFile
     repo = JsonFile(self.dependencies)
     img1 = self.imageWithProvenance({'id':'1'})
     img2 = self.imageWithProvenance({'id':'2'})
     img3 = self.imageWithProvenance({'id':'3'})
     repo.all = Mock()
     repo.all.return_value = [img1, img2, img3]
     out = repo.byId('2')
     self.assertEqual(img2, out)