Esempio n. 1
0
    def test_hdf5_incorrect_channel(self):
        """Post hdf5 data with incorrect channel"""

        time_data = np.ones([3, 10, 100, 100],
                            dtype=np.float32) * random.random()
        response = postHDF5(p, time_data)
        assert (response.status_code == 404)
Esempio n. 2
0
    def test_hdf5_incorrect_channel(self):
        """Post hdf5 data with incorrect channel"""

        image_data = np.ones([3, 10, 100, 100],
                             dtype=np.uint8) * random.randint(0, 255)
        response = postHDF5(p, image_data)
        assert (response.code == 404)
  def test_hdf5_incorrect_channel (self):
    """Post hdf5 data with incorrect channel"""

    p.args = (5000,5100,4000,4100,500,510,50,52)
    image_data = np.ones ( [3,2,10,100,100], dtype=np.uint8 ) * random.randint(0,255)
    response = postHDF5(p, image_data, time=True)
    assert (response.code == 404)
Esempio n. 4
0
  def test_hdf5_incorrect_region (self):
    """Post hdf5 file to an incorrect region"""

    p.args = (11000,11100,4000,4100,500,510)
    image_data = np.ones ( [2,10,100,100], dtype=np.float32 ) * random.random()
    response = postHDF5(p, image_data)
    assert (response.code == 404)
  def test_hdf5_incorrect_region (self):
    """Post hdf5 file to an incorrect region"""

    p.args = (8000,7000,4000,4100,500,510,110,115)
    image_data = np.ones ( [2,5,10,100,100], dtype=np.uint8 ) * random.randint(0,255)
    response = postHDF5(p, image_data, time=True)
    assert (response.code == 404)
Esempio n. 6
0
    def test_hdf5_incorrect_region(self):
        """Post hdf5 file to an incorrect region"""

        p.args = (11000, 11100, 4000, 4100, 500, 510)
        time_data = np.ones([2, 10, 100, 100],
                            dtype=np.float32) * random.random()
        response = postHDF5(p, time_data)
        assert (response.status_code == 404)
Esempio n. 7
0
  def test_hdf5_incorrect_datatype (self):
    """Post hdf5 data with incorrect datatype"""

    p.args = (6000,6100,4000,4100,500,510)
    # upload some image data
    image_data = np.empty((2,10,100,100))
    image_data[0,:] = np.ones ( [10,100,100], dtype=np.float32 ) * random.random()
    image_data[1,:] = np.ones ( [10,100,100], dtype=np.float32 ) * random.random()

    response = postHDF5(p, image_data)
    assert ( response.code == 404 )
  def test_hdf5_incorrect_datatype (self):
    """Post hdf5 data with incorrect datatype"""

    p.args = (6000,6100,4000,4100,500,510,50,52)
    # upload some image data
    image_data = np.empty((2,2,10,100,100))
    image_data[0,:] = np.ones ( [2,10,100,100], dtype=np.uint8 ) * random.randint(0,255)
    image_data[1,:] = np.ones ( [2,10,100,100], dtype=np.uint16 ) * random.randint(0,255)

    response = postHDF5(p, image_data, time=True)
    assert ( response.code == 404 )
Esempio n. 9
0
    def test_hdf5_incorrect_datatype(self):
        """Post hdf5 data with incorrect datatype"""

        p.args = (6000, 6100, 4000, 4100, 500, 510)
        # upload some image data
        time_data = np.empty((2, 10, 100, 100))
        time_data[0, :] = np.ones([10, 100, 100],
                                  dtype=np.float32) * random.random()
        time_data[1, :] = np.ones([10, 100, 100],
                                  dtype=np.float32) * random.random()

        response = postHDF5(p, time_data)
        assert (response.status_code == 404)
Esempio n. 10
0
  def test_hdf5 (self):
    """Post hdf5 data to correct region with correct datatype"""

    p.args = (2000,2100,4000,4100,500,510)
    # upload some image data
    image_data = np.ones ( [2,10,100,100], dtype=np.float32 ) * random.random()

    response = postHDF5(p, image_data)
    assert ( response.code == 200 )
    h5f = getHDF5(p)

    for idx, channel_name in enumerate(p.channels):
      assert ( np.array_equal(h5f.get(channel_name).get('CUTOUT').value, image_data[idx,:]) )
Esempio n. 11
0
  def test_hdf5 (self):
    """Post hdf5 data to correct region with correct datatype"""

    p.args = (2000,2100,4000,4100,500,510,10,15)
    # upload some image data
    image_data = np.ones ( [2,5,10,100,100], dtype=np.uint8 ) * random.randint(0,255)

    response = postHDF5(p, image_data, time=True)
    assert ( response.code == 200 )
    h5f = getHDF5(p, time=True)

    for idx, channel_name in enumerate(p.channels):
      assert ( np.array_equal(h5f.get(channel_name).get('CUTOUT').value, image_data[idx,:]) )
Esempio n. 12
0
    def test_hdf5(self):
        """Post hdf5 data to correct region with correct datatype"""

        p.args = (2000, 2100, 4000, 4100, 500, 510)
        # upload some image data
        time_data = np.ones([2, 10, 100, 100],
                            dtype=np.float32) * random.random()

        response = postHDF5(p, time_data)
        assert (response.status_code == 200)
        h5f = getHDF5(p)

        for idx, channel_name in enumerate(p.channels):
            assert (np.array_equal(
                h5f.get(channel_name).get('CUTOUT').value, time_data[idx, :]))
Esempio n. 13
0
  def test_hdf5_incorrect_channel (self):
    """Post hdf5 data with incorrect channel"""

    image_data = np.ones ( [3,10,100,100], dtype=np.float32 ) * random.random()
    response = postHDF5(p, image_data)
    assert (response.code == 404)
Esempio n. 14
0
  def test_hdf5_incorrect_channel (self):
    """Post hdf5 data with incorrect channel"""

    image_data = np.ones ( [3,10,100,100], dtype=np.uint8 ) * random.randint(0,255)
    response = postHDF5(p, image_data)
    assert (response.status_code == 404)