Skip to content

Regression

OmeroWeb.test.integration.test_api_containers.TestContainers.test_spw_urls (from pytest)

Failing for the past 1 build (Since #412 )
Took 2.4 sec.

Error Message

failed on setup with "AttributeError: 'numpy.ndarray' object has no attribute 'tostring'"

Stacktrace

self = <test_api_containers.TestContainers object at 0x7ff4d156f1d0>
user1 = (<omero.clients.BaseClient object at 0x7ff4cd142410>, object #0 (::omero::model::Experimenter)
{
    _id = object #1 (...nnotationLinksSeq = 
    {
    }
    _annotationLinksLoaded = False
    _annotationLinksCountPerOwner = 
    {
    }
})

    @pytest.fixture()
    def screen_plates(self, user1):
        """Return Screen with Plates and an orphaned Plate."""
        # Create and name all the objects
        screen = ScreenI()
        screen.name = rstring('screen')
    
        for i in range(5):
            plate1 = PlateI()
            plate1.name = rstring('Plate%s' % i)
            screen.linkPlate(plate1)
    
        # Create single orphaned Plate
        plate = PlateI()
        plate.name = rstring('plate')
    
        screen = get_update_service(user1).saveAndReturnObject(screen)
        plate = get_update_service(user1).saveAndReturnObject(plate)
    
        # Add well to first plate
        plates = screen.linkedPlateList()
        plates.sort(key=lambda x: lower_or_none(unwrap(x.name)))
        plate_id = plates[0].id.val
        well = WellI()
        well.column = rint(0)
        well.row = rint(0)
        well.plate = PlateI(plate_id, False)
>       image = self.create_test_image(
            size_x=5, size_y=5, session=user1[0].getSession())

test/integration/test_api_containers.py:166: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../../../../.venv3/lib64/python3.11/site-packages/omero/testlib/__init__.py:445: in create_test_image
    script_utils.upload_plane(raw_pixel_store, plane_2d,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

raw_pixels_store = e1449517-38fb-478c-a2a3-0da2cde45e42/995f3bb7-42fc-4117-9958-5d38e13b5ff2omero.api.RawPixelsStore -t -e 1.1:tcp -h 172.18.0.11 -p 36999 -t 60000
plane = array([[0, 1, 2, 3, 4],
       [0, 1, 2, 3, 4],
       [0, 1, 2, 3, 4],
       [0, 1, 2, 3, 4],
       [0, 1, 2, 3, 4]], dtype=int16)
z = 0, c = 0, t = 0

    def upload_plane(raw_pixels_store, plane, z, c, t):
        """
        Upload the plane to the server attaching it to the current z,c,t
        of the already instantiated rawPixelStore.
    
        :param raw_pixels_store store pointing to the data.
        :param plane The data to upload
        :param z The Z-Section of the plane.
        :param c The C-Section of the plane.
        :param t The T-Section of the plane.
        """
        byte_swapped_plane = plane.byteswap()
>       converted_plane = byte_swapped_plane.tostring()
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
E       AttributeError: 'numpy.ndarray' object has no attribute 'tostring'

../../../../.venv3/lib64/python3.11/site-packages/omero/util/script_utils.py:1088: AttributeError