

import numpy as np
from datajoint.blob import pack, unpack
from numpy.testing import assert_array_equal, raises


def test_pack():
    x = np.random.randn(8, 10)
    assert_array_equal(x, unpack(pack(x)), "Arrays do not match!")

    x = np.random.randn(10)
    assert_array_equal(x, unpack(pack(x)), "Arrays do not match!")

    x = np.float32(np.random.randn(3, 4, 5))
    assert_array_equal(x, unpack(pack(x)), "Arrays do not match!")

    x = np.int16(np.random.randn(1, 2, 3))
    assert_array_equal(x, unpack(pack(x)), "Arrays do not match!")

    x = {'name': 'Anonymous', 'age': 15}
    assert(x == unpack(pack(x)), "Dict do not match!")


def test_complex():
    z = np.random.randn(8, 10) + 1j*np.random.randn(8,10)
    assert_array_equal(z, unpack(pack(z)), "Arrays do not match!")

    z = np.random.randn(10) + 1j*np.random.randn(10)
    assert_array_equal(z, unpack(pack(z)), "Arrays do not match!")

    x = np.float32(np.random.randn(3, 4, 5)) + 1j*np.float32(np.random.randn(3, 4, 5))
    assert_array_equal(x, unpack(pack(x)), "Arrays do not match!")

    x = np.int16(np.random.randn(1, 2, 3)) + 1j*np.int16(np.random.randn(1, 2, 3))
    assert_array_equal(x, unpack(pack(x)), "Arrays do not match!")

@@ -1,10 +1,8 @@
-%0A%0A
 import n
@@ -105,16 +105,65 @@
  raises%0A
+from nose.tools import assert_false, assert_true%0A
 %0A%0Adef te
@@ -643,16 +643,21 @@
   assert
+_true
 (x == un
@@ -664,24 +664,38 @@
 pack(pack(x)
+, as_dict=True
 ), %22Dict do 

Use proper assert in tests