コード例 #1
0
 def test_add_entry(self):
     from jicbioimage.core.io import Manifest
     manifest = Manifest()
     self.assertEqual(len(manifest), 0)
     entry = manifest.add(filename="my_image.png")
     self.assertEqual(len(manifest), 1)
     self.assertTrue(isinstance(entry, dict))
     self.assertEqual(entry["filename"], "my_image.png")
コード例 #2
0
 def test_add_entry(self):
     from jicbioimage.core.io import Manifest
     manifest = Manifest()
     self.assertEqual(len(manifest), 0)
     entry = manifest.add(filename="my_image.png")
     self.assertEqual(len(manifest), 1)
     self.assertTrue(isinstance(entry, dict))
     self.assertEqual(entry["filename"], "my_image.png")
コード例 #3
0
 def test_json(self):
     from jicbioimage.core.io import Manifest
     manifest = Manifest()
     manifest.add(filename="my_image.png", series=0)
     self.assertEqual(manifest.json,
                      '[{"filename": "my_image.png", "series": 0}]')
コード例 #4
0
 def test_initialisation(self):
     from jicbioimage.core.io import Manifest
     manifest = Manifest()
     self.assertTrue(isinstance(manifest, list))
コード例 #5
0
 def test_json(self):
     from jicbioimage.core.io import Manifest
     manifest = Manifest()
     manifest.add(filename="my_image.png", series=0)
     self.assertEqual(manifest.json,
                      '[{"filename": "my_image.png", "series": 0}]')