def testConfigInstallProjectInstall(self): args = ["--root=%s" % self.siteroot, "--repo=%s" % self.repourl, "Brunel", "v43r1p1"] client = InstallProjectClient(TESTCONFIG, args) rc = client.main() self.assertEquals(rc, 0) for path in [ "lhcb/BRUNEL/BRUNEL_v43r1p1"]: self.assertTrue(os.path.exists(os.path.join(self.siteroot, path)))
def testInstallProjectClientNobin(self): os.environ['CMTCONFIG'] = "MYCONFIG" client = InstallProjectClient(TESTCONFIG, ["BRUNEL", "vXrY"], True) rc = client.main() self.assertEquals(rc, 0) self.assertEquals(client.runMethod, "install") self.assertEquals(client.runArgs[0], "BRUNEL") self.assertEquals(client.runArgs[1], "vXrY") self.assertEquals(client.runArgs[2], None)
def testInstallProjectClientCmdlineBin(self): os.environ['CMTCONFIG'] = "MYCONFIG" client = InstallProjectClient(TESTCONFIG, ["--binary=TOTO", "BRUNEL"], True) rc = client.main() self.assertEquals(rc, 0) self.assertEquals(client.runMethod, "install") self.assertEquals(client.runArgs[0], "BRUNEL") self.assertEquals(client.runArgs[1], None) self.assertEquals(client.runArgs[2], "TOTO")
def testInstallProjectClientBadBin(self): if 'CMTCONFIG' in os.environ.keys(): del os.environ['CMTCONFIG'] client = InstallProjectClient(TESTCONFIG, ["-b", "BRUNEL"], True) rc = client.main() self.assertEquals(rc, 1)
def testArgParsing(self): parser = InstallProjectClient(TESTCONFIG).parser opts, args = parser.parse_args(["-b", "-d", "x", "titi", "toto"]) #@UnusedVariable self.assertTrue(opts.useCMTCONFIG)
def testOptsBinaryShort(self): parser = InstallProjectClient(TESTCONFIG).parser opts, args = parser.parse_args(["-b"]) #@UnusedVariable self.assertTrue(opts.useCMTCONFIG)
def testOptsBinary(self): parser = InstallProjectClient(TESTCONFIG).parser opts, args = parser.parse_args(["--binary=xbin"]) #@UnusedVariable self.assertEquals(opts.binary, "xbin")