File: test_nested_list.py

package info (click to toggle)
gamera 1:3.4.2+git20160808.1725654-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 22,312 kB
  • ctags: 24,991
  • sloc: xml: 122,324; ansic: 52,869; cpp: 50,664; python: 35,034; makefile: 118; sh: 101
file content (16 lines) | stat: -rw-r--r-- 549 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from gamera.core import *

from gamera.core import *
init_gamera()

def test_nested_list():
   def _test_nested_list(name, type, storage = DENSE):
      image = load_image("data/%s_generic.tiff" % name, storage)
      nested = image.to_nested_list()
      image2 = nested_list_to_image(nested, type)
      assert image._to_raw_string() == image2._to_raw_string()

   # TODO: Add Grey16
   for name, type in [("OneBit", ONEBIT), ("GreyScale", GREYSCALE), ("RGB", RGB)]:
      _test_nested_list(name, type)
   _test_nested_list("OneBit", ONEBIT, RLE)