Example #1
0
 def test_labeledimage_pack_for_json_pretty(self):
     labeled = AnnotatedImage(INFO_F0, '1-cell')
     packed_true = labeled.pack_for_json(pretty=True)
     packed_false = labeled.pack_for_json(pretty=False)
     # truth = {INFO_F0.image_number: '1-cell'}
     truth = '1-cell'
     self.assertEqual(packed_true, truth)
     self.assertEqual(packed_false, truth)
Example #2
0
 def test_pack_for_json_when_annotation_has_pack_for_json_method(self):
     data = 3
     annotation = AnnotatedImage(INFO_F0, data)
     image = AnnotatedImage(INFO_F0, annotation)
     packed = image.pack_for_json()
     self.assertEqual(packed, data)
Example #3
0
 def test_labeledimage_pack_for_json(self):
     annotation = '1-cell'
     labeled = AnnotatedImage(INFO_F0, annotation)
     packed = labeled.pack_for_json()
     # truth = {INFO_F0.image_number: '1-cell'}
     self.assertEqual(packed, annotation)
Example #4
0
 def test_pack_for_json_when_annotation_is_simple(self):
     annotation = 3
     image = AnnotatedImage(INFO_F0, annotation)
     packed = image.pack_for_json()
     self.assertEqual(packed, annotation)