Esempio n. 1
0
	def testDownloadPicture(self):
		if os.path.exists('test.jpg'):
			os.remove('test.jpg')
		biaflows = BIAFlows()
		biaflows.downloadPicture('/api/attachedfile/', '5363317', 'test.jpg')
		fileExists = os.path.exists('test.jpg')
		self.assertEquals(fileExists, True)
		os.remove('test.jpg')
Esempio n. 2
0
	def __init__(self): 
		'''
		Create and display the connection window.
		'''
		super(ConnectionWindow, self).__init__("BIAFlows Connection")
		self.biaflows = BIAFlows.getInstance()
		self.createAndShowGUI()
		self.addWindowListener(self)
		WindowManager.addWindow(self)
Esempio n. 3
0
	def setUp(self):
		biaflows = BIAFlows('http://biaflows/', '7fe8b526-93ae-481e-932d-e1e0bb598529', '45953ccd-0984-4471-ba68-31c6d212699a')
		IJ.newImage("Ramp", "8-bit ramp", 256, 256, 1)
		imp = IJ.getImage()
		IJ.saveAs("tiff", "./ctest.tif")
		imp.close()

		projects = Projects()
		names = projects.getNames()
		ids = projects.getIDs()
		index = -1
		pid = -1
		try:
			index = names.index('upload-test')
			pid = ids[index]
		except ValueError, e:
			p = Project(name, Ontology('upload-test')).save()
			pid = p.getId()
Esempio n. 4
0
	def setUp(self):
		 BIAFlows()
Esempio n. 5
0
	def testGetInstance(self):
		newInst = BIAFlows.getInstance()
		existingInst = BIAFlows.getInstance()
		self.assertEquals(newInst, existingInst)
		self.assertEquals(existingInst.getHost(), 'https://biaflows.neubias.org')
Esempio n. 6
0
	def testGetUploadURL(self):
		biaflows = BIAFlows.getInstance()
		url = biaflows.getUploadURL()
		self.assertEquals(url.find('-upload')>=0, True)
Esempio n. 7
0
	def testSetPrivateKey(self):
		biaflows = BIAFlows.getInstance()
		biaflows.setPrivateKey("k2k2k2");
		self.assertEquals(BIAFlows.getInstance().getPrivateKey(), 'k2k2k2')
Esempio n. 8
0
	def testGetPrivateKey(self):
		self.assertEquals(BIAFlows.getInstance().getPrivateKey(), '73b7df42-3484-4c1b-9bf2-8d9e3ea53eac')
Esempio n. 9
0
	def testSetPublicKey(self):
		biaflows = BIAFlows.getInstance()
		biaflows.setPublicKey("k1k1k1");
		self.assertEquals(BIAFlows.getInstance().getPublicKey(), 'k1k1k1')
Esempio n. 10
0
	def testGetPublicKey(self):
		self.assertEquals(BIAFlows.getInstance().getPublicKey(), 'c0f3be78-a1a7-4d86-ad09-9e1753f26a8b')
Esempio n. 11
0
	def testSetHost(self):
		biaflows = BIAFlows()
		biaflows.setHost("a.b.c")
		self.assertEquals(biaflows.getHost(), 'a.b.c')
Esempio n. 12
0
	def testGetHost(self):
		biaflows = BIAFlows()
		self.assertEquals(biaflows.getHost(), 'https://biaflows.neubias.org')
Esempio n. 13
0
	def testConstructorWithArgs(self):
		biaflows = BIAFlows('https://url.org', '000', '111')
		self.assertEquals(biaflows.getHost(), 'https://url.org')
Esempio n. 14
0
	def testConstructorNoArgs(self):
		biaflows = BIAFlows()
		self.assertEquals(biaflows.getHost(), 'https://biaflows.neubias.org')