#!/usr/bin/env python

import numpy as np
import cython_resize


print "testing correct array"
a2 = cython_resize.none_test(np.arange(5, dtype=np.uint8))

print "testing wrong dtype"
try:
    a2 = cython_resize.none_test(np.arange(5, dtype=np.int16))
except ValueError:
    print "got a value error for wrong dtype: good!"

print "testing wrong dimensions"
try:
    a2 = cython_resize.none_test(np.ones((5,3), dtype=np.uint8))
except ValueError:
    print "got a value error for wrong dimensions: good!"

print "testing non numpy array"
try:
    a2 = cython_resize.none_test("a string")
except TypeError:
    print "got a TypeError for wrong type: good!"

print "testing None"
a2 = cython_resize.none_test(None)
print "oops -- no error for None!", a2
