File: test_nested_list.py

package info (click to toggle)
gamera 3.4.1+svn1423-4
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 22,292 kB
  • ctags: 25,015
  • sloc: xml: 122,324; ansic: 50,812; cpp: 50,489; python: 34,987; makefile: 119; 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)