def test_read_bin_lush_matrix_ubyte_3tensor():
 path = (example_bin_lush_path + 'ubyte_3tensor.lushbin')
 result = read_bin_lush_matrix(path)
 assert (str(result.dtype) == 'uint8')
 assert (len(result.shape) == 3)
 if (result.shape != (2, 3, 4)):
  raise AssertionError(('ubyte_3tensor.lushbin stores a 3-tensor of shape (2,3,4), but read_bin_lush_matrix thinks it has shape ' + str(result.shape)))
 for i in xrange(1, 3):
  for j in xrange(1, 4):
   for k in xrange(1, 5):
    assert (result[((i - 1), (j - 1), (k - 1))] == ((i + (3 * j)) + (12 * k)))

def test_read_bin_lush_matrix_ubyte_3tensor ( ) : path = ( example_bin_lush_path + 'ubyte_3tensor.lushbin' ) result = read_bin_lush_matrix ( path ) assert ( str ( result . dtype ) == 'uint8' ) assert ( len ( result . shape ) == 3 ) if ( result . shape != ( 2 , 3 , 4 ) ) : raise AssertionError ( ( 'ubyte_3tensor.lushbin stores a 3-tensor of shape (2,3,4), but read_bin_lush_matrix thinks it has shape ' + str ( result . shape ) ) ) for i in xrange ( 1 , 3 ) : for j in xrange ( 1 , 4 ) : for k in xrange ( 1 , 5 ) : assert ( result [ ( ( i - 1 ) , ( j - 1 ) , ( k - 1 ) ) ] == ( ( i + ( 3 * j ) ) + ( 12 * k ) ) )
read data from a lush file with uint8 data .