コード例 #1
0
 def testUnloadSet(self):
     img = ImageI()
     self.assert_(img.sizeOfPixels() >= 0)
     img.addPixels(PixelsI())
     self.assert_(1 == img.sizeOfPixels())
     img.unloadPixels()
     self.assert_(img.sizeOfPixels() < 0)
コード例 #2
0
 def testUnloadSet(self):
     img = ImageI()
     assert img.sizeOfPixels() >= 0
     img.addPixels(PixelsI())
     assert 1 == img.sizeOfPixels()
     img.unloadPixels()
     assert img.sizeOfPixels() < 0
コード例 #3
0
    def testWrappers(self):
        image = ImageI()
        info = image._field_info

        assert info.name.wrapper == rstring
        assert info.acquisitionDate.wrapper == rtime

        assert not info.name.nullable
        assert info.acquisitionDate.nullable

        image.setAcquisitionDate("1", wrap=True)
        assert type(image.acquisitionDate) == type(rtime(0))

        # The following causes pytest to fail!
        # image.setAcquisitionDate("", wrap=True)

        # Note: collections still don't work well
        if False:
            image.addPixels(PixelsI())
            image.setPixels(0, "Pixels:1", wrap=True)
            assert type(image.pixels) == omero.model.PixelsI

            image.setPixels(0, "Pixels", wrap=True)
            image.setPixels(0, "Unknown", wrap=True)

        link = DatasetImageLinkI()
        link.setParent("Dataset:1")
        link.setChild("Image:1")
コード例 #4
0
 def testClearSet(self):
     img = ImageI()
     self.assert_(img.sizeOfPixels() >= 0)
     img.addPixels(PixelsI())
     self.assert_(1 == img.sizeOfPixels())
     img.clearPixels()
     self.assert_(img.sizeOfPixels() >= 0)
     self.assert_(0 == img.sizeOfPixels())
コード例 #5
0
 def testClearSet(self):
     img = ImageI()
     assert img.sizeOfPixels() >= 0
     img.addPixels(PixelsI())
     assert 1 == img.sizeOfPixels()
     img.clearPixels()
     assert img.sizeOfPixels() >= 0
     assert 0 == img.sizeOfPixels()
コード例 #6
0
 def testOrderedCollectionsTicket2547(self):
     pixels = PixelsI()
     channels = [ChannelI() for x in range(3)]
     pixels.addChannel(channels[0])
     self.assertEquals(1, pixels.sizeOfChannels())
     old = pixels.setChannel(0, channels[1])
     self.assertEquals(old, channels[0])
     self.assertEquals(1, pixels.sizeOfChannels())
コード例 #7
0
 def testOrderedCollectionsTicket2547(self):
     pixels = PixelsI()
     channels = [ChannelI() for x in range(3)]
     pixels.addChannel(channels[0])
     assert 1 == pixels.sizeOfChannels()
     old = pixels.setChannel(0, channels[1])
     assert old == channels[0]
     assert 1 == pixels.sizeOfChannels()
コード例 #8
0
    def testRemoveFromSet(self):
        pix = PixelsI()
        img = ImageI()
        self.assert_(img.sizeOfPixels() >= 0)

        img.addPixels(pix)
        self.assert_(1 == img.sizeOfPixels())

        img.removePixels(pix)
        self.assert_(0 == img.sizeOfPixels())
コード例 #9
0
    def testRemoveFromSet(self):
        pix = PixelsI()
        img = ImageI()
        assert img.sizeOfPixels() >= 0

        img.addPixels(pix)
        assert 1 == img.sizeOfPixels()

        img.removePixels(pix)
        assert 0 == img.sizeOfPixels()
コード例 #10
0
ファイル: test_model.py プロジェクト: sbesson/openmicroscopy
 def testOrderedCollectionsTicket2547(self):
     pixels = PixelsI()
     channels = [ChannelI() for x in range(3)]
     pixels.addChannel(channels[0])
     assert 1 == pixels.sizeOfChannels()
     old = pixels.setChannel(0, channels[1])
     assert old == channels[0]
     assert 1 == pixels.sizeOfChannels()
コード例 #11
0
ファイル: t_model.py プロジェクト: DirkHaehnel/openmicroscopy
 def testOrderedCollectionsTicket2547(self):
     pixels = PixelsI()
     channels = [ChannelI() for x in range(3)]
     pixels.addChannel(channels[0])
     self.assertEquals(1, pixels.sizeOfChannels())
     old = pixels.setChannel(0, channels[1])
     self.assertEquals(old, channels[0])
     self.assertEquals(1, pixels.sizeOfChannels())
コード例 #12
0
ファイル: test_model.py プロジェクト: sbesson/openmicroscopy
 def testUnloadCollections(self):
     pix = PixelsI()
     assert pix.sizeOfSettings() >= 0
     pix.unloadCollections()
     assert pix.sizeOfSettings() < 0
コード例 #13
0
 def testUnloadCollections(self):
     pix = PixelsI()
     self.assert_(pix.sizeOfSettings() >= 0)
     pix.unloadCollections()
     self.assert_(pix.sizeOfSettings() < 0)
コード例 #14
0
 def testUnloadCollections(self):
     pix = PixelsI()
     assert pix.sizeOfSettings() >= 0
     pix.unloadCollections()
     assert pix.sizeOfSettings() < 0
コード例 #15
0
ファイル: t_model.py プロジェクト: DirkHaehnel/openmicroscopy
 def testUnloadCollections(self):
     pix = PixelsI()
     self.assert_( pix.sizeOfSettings() >= 0 )
     pix.unloadCollections()
     self.assert_( pix.sizeOfSettings() < 0 )