File: test_nested_list.py

package info (click to toggle)
gamera 3.3.3-2+deb7u1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 20,660 kB
  • sloc: xml: 125,029; ansic: 50,554; cpp: 41,927; python: 33,625; makefile: 107; perl: 29; sh: 28
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)