def testUnloadedCtor(self): img = ImageI(rlong(1), False) assert not img.isLoaded() try: assert img.sizeOfDatasetLinks() < 0 assert False, "Should throw" except: # Is true, but can't test it. pass
def testUnloadedCtor(self): img = ImageI(rlong(1), False) self.assert_(not img.isLoaded()) try: self.assert_(img.sizeOfDatasetLinks() < 0) self.fail("Should throw") except: # Is true, but can't test it. pass
def testUnloadedCtor(self): img = ImageI(rlong(1),False) self.assert_( not img.isLoaded() ) try: self.assert_( img.sizeOfDatasetLinks() < 0 ) self.fail("Should throw") except: # Is true, but can't test it. pass
def testLinkingAndUnlinking(self): d = DatasetI() i = ImageI() d.linkImage(i) assert d.sizeOfImageLinks() == 1 d.unlinkImage(i) assert d.sizeOfImageLinks() == 0 d = DatasetI() i = ImageI() d.linkImage(i) assert i.sizeOfDatasetLinks() == 1 i.unlinkDataset(d) assert d.sizeOfImageLinks() == 0 d = DatasetI() i = ImageI() dil = DatasetImageLinkI() dil.link(d, i) d.addDatasetImageLink(dil, False) assert d.sizeOfImageLinks() == 1 assert i.sizeOfDatasetLinks() == 0
def testLinkingAndUnlinking(self): d = DatasetI() i = ImageI() d.linkImage(i) self.assert_(d.sizeOfImageLinks() == 1) d.unlinkImage(i) self.assert_(d.sizeOfImageLinks() == 0) d = DatasetI() i = ImageI() d.linkImage(i) self.assert_(i.sizeOfDatasetLinks() == 1) i.unlinkDataset(d) self.assert_(d.sizeOfImageLinks() == 0) d = DatasetI() i = ImageI() dil = DatasetImageLinkI() dil.link(d, i) d.addDatasetImageLink(dil, False) self.assert_(d.sizeOfImageLinks() == 1) self.assert_(i.sizeOfDatasetLinks() == 0)
def testLinkingAndUnlinking(self): d = DatasetI() i = ImageI() d.linkImage(i) self.assert_( d.sizeOfImageLinks() == 1 ) d.unlinkImage(i) self.assert_( d.sizeOfImageLinks() == 0 ) d = DatasetI() i = ImageI() d.linkImage(i) self.assert_( i.sizeOfDatasetLinks() == 1 ) i.unlinkDataset(d) self.assert_( d.sizeOfImageLinks() == 0 ) d = DatasetI() i = ImageI() dil = DatasetImageLinkI() dil.link(d,i) d.addDatasetImageLink(dil, False) self.assert_( d.sizeOfImageLinks() == 1 ) self.assert_( i.sizeOfDatasetLinks() == 0 )