File: grayscale_test.py

package info (click to toggle)
python-mapnik 1%3A0.0~20180723-588fc9062-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 10,768 kB
  • sloc: python: 12,085; cpp: 5,721; sh: 101; makefile: 19
file content (16 lines) | stat: -rw-r--r-- 365 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from nose.tools import eq_

import mapnik

from .utilities import run_all


def test_grayscale_conversion():
    im = mapnik.Image(2, 2)
    im.fill(mapnik.Color('white'))
    im.set_grayscale_to_alpha()
    pixel = im.get_pixel(0, 0)
    eq_((pixel >> 24) & 0xff, 255)

if __name__ == "__main__":
    exit(run_all(eval(x) for x in dir() if x.startswith("test_")))