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)
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)
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')
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)
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)
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([]))
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')
def testPrereqs(self): cSystem = ContainerSystem(cDir=self.cDir, mDir=self.mDir, forceImage=False, prereqs="tacc-singularity", threads=2)
def testGenLMOD(self): cSystem = ContainerSystem(cDir=self.cDir, mDir=self.mDir, forceImage=False, threads=2)
def testFindCommon(self): cSystem = ContainerSystem(cDir=self.cDir, mDir=self.mDir, forceImage=False)
def testCacheProgs(self): cSystem = ContainerSystem(cDir=self.cDir, mDir=self.mDir, forceImage=False)
def testMetadata(self): cSystem = ContainerSystem(cDir=self.cDir, mDir=self.mDir, forceImage=False)
def testDeleteImageForce(self): cSystem = ContainerSystem(cDir=self.cDir, mDir=self.mDir, forceImage=True)
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]))
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'))