Beispiel #1
0
	def testValidURLs(self):
		cSystem = ContainerSystem(cDir=self.cDir, mDir=self.mDir, forceImage=False)
		cSystem.validateURLs(self.urls)
		self.assertTrue(self.good_dh_url not in cSystem.invalid)
		self.assertTrue(self.bad_dh_url in cSystem.invalid)
		self.assertTrue(self.good_quay_url not in cSystem.invalid)
		self.assertTrue(self.bad_quay_url in cSystem.invalid)
Beispiel #2
0
	def testPull(self):
		cSystem = ContainerSystem(cDir=self.cDir, mDir=self.mDir, forceImage=False)
		cSystem.pullAll([self.good_quay_url, self.bad_dh_url], 2)
		self.assertTrue(self.good_quay_url in cSystem.images)
		self.assertTrue(self.good_quay_url not in cSystem.invalid)
		self.assertTrue(self.bad_dh_url not in cSystem.images)
		self.assertTrue(self.bad_dh_url in cSystem.invalid)
Beispiel #3
0
	def testGetFull(self):
		cSystem = ContainerSystem(cDir=self.cDir, mDir=self.mDir, forceImage=False)
		for url in self.urls:
			cSystem._getFullURL(url)
		self.assertEqual(cSystem.full_url[self.good_quay_url],'https://quay.io/repository/biocontainers/samtools')
		self.assertEqual(cSystem.full_url[self.bad_quay_url],'https://quay.io/repository/biocontainers/samtools')
		self.assertEqual(cSystem.full_url[self.good_dh_url],'https://hub.docker.com/r/biocontainers/samtools')
		self.assertEqual(cSystem.full_url[self.bad_dh_url],'https://hub.docker.com/r/biocontainers/samtools')
Beispiel #4
0
	def testPullAll(self):
		cSystem = ContainerSystem(cDir=self.cDir, mDir=self.mDir, forceImage=False)
		cSystem.pullAll(self.urls, 4)
		#output = logStream.getvalue()
		#print(output)
		self.assertTrue(self.good_dh_url in cSystem.images)
		self.assertTrue(self.good_quay_url in cSystem.images)
		self.assertTrue(self.good_dh_url not in cSystem.invalid)
		self.assertTrue(self.good_quay_url not in cSystem.invalid)
		self.assertTrue(self.bad_dh_url not in cSystem.images)
		self.assertTrue(self.bad_quay_url not in cSystem.images)
		self.assertTrue(self.bad_dh_url in cSystem.invalid)
		self.assertTrue(self.bad_quay_url in cSystem.invalid)
Beispiel #5
0
	def testPullForce(self):
		cSystem = ContainerSystem(cDir=self.cDir, mDir=self.mDir, forceImage=True)
		cSystem.validateURLs(self.urls)
		cSystem.pullAll(self.urls, 4)
		for url in self.good_urls:
			self.assertTrue(os.path.exists(cSystem.images[url]))
			self.assertTrue(url in cSystem.full_url)
			self.assertTrue(url in cSystem.keywords)
		for url in self.bad_urls:
			self.assertFalse(url in cSystem.images)
			self.assertFalse(url in cSystem.full_url)
			self.assertFalse(url in cSystem.keywords)
Beispiel #6
0
	def testTags(self):
		cSystem = ContainerSystem(cDir=self.cDir, mDir=self.mDir, forceImage=False)
		self.assertTrue('1.2' in cSystem._getTags(self.good_dh_url))
		self.assertTrue('1.0--hdd8ed8b_2' in cSystem._getTags(self.good_quay_url))
		self.assertEqual(cSystem._getTags('biocontainers/samtoolz:1.3'), set([]))
		self.assertEqual(cSystem._getTags('quay.io/biocontainers/samtoolz:1.3'), set([]))
Beispiel #7
0
	def testGetRegistry(self):
		cSystem = ContainerSystem(cDir=self.cDir, mDir=self.mDir, forceImage=False)
		cSystem._getRegistry(self.good_dh_url)
		self.assertEqual(cSystem.registry[self.good_dh_url], 'dockerhub')
		cSystem._getRegistry(self.good_quay_url)
		self.assertEqual(cSystem.registry[self.good_quay_url], 'quay')
Beispiel #8
0
	def testPrereqs(self):
		cSystem = ContainerSystem(cDir=self.cDir, mDir=self.mDir, forceImage=False, prereqs="tacc-singularity", threads=2)
Beispiel #9
0
	def testGenLMOD(self):
		cSystem = ContainerSystem(cDir=self.cDir, mDir=self.mDir, forceImage=False, threads=2)
Beispiel #10
0
	def testFindCommon(self):
		cSystem = ContainerSystem(cDir=self.cDir, mDir=self.mDir, forceImage=False)
Beispiel #11
0
	def testCacheProgs(self):
		cSystem = ContainerSystem(cDir=self.cDir, mDir=self.mDir, forceImage=False)
Beispiel #12
0
	def testMetadata(self):
		cSystem = ContainerSystem(cDir=self.cDir, mDir=self.mDir, forceImage=False)
Beispiel #13
0
	def testDeleteImageForce(self):
		cSystem = ContainerSystem(cDir=self.cDir, mDir=self.mDir, forceImage=True)
Beispiel #14
0
	def testPullImageForce(self):
		cSystem = ContainerSystem(cDir=self.cDir, mDir=self.mDir, forceImage=True)
		url = self.good_quay_url
		cSystem._pullImage(url)
		self.assertTrue(os.path.exists(cSystem.images[url]))
Beispiel #15
0
	def testGetNameTag(self):
		cSystem = ContainerSystem(cDir=self.cDir, mDir=self.mDir, forceImage=False)
		cSystem._getNameTag(self.good_dh_url)
		self.assertEqual(cSystem.name_tag[self.good_dh_url], ('samtools', 'v1.7.0_cv2'))
		cSystem._getNameTag('gzynda/singularity')
		self.assertEqual(cSystem.name_tag['gzynda/singularity'], ('singularity', 'latest'))