def run(shouldExit=False): config = SelectSdssImagesTask.ConfigClass() try: user = DbAuth.username(config.host, str(config.port)), except Exception: print "Warning: did not find host=%s, port=%s in your db-auth file; skipping SelectSdssImagesTask unit tests" % \ (config.host, str(config.port)) return utilsTests.run(suite(), shouldExit)
def run(shouldExit=False): status = utilsTests.run(suite(), False) if os.path.exists(DATAREPO_ROOT): if CLEANUP_DATAREPO: if status == 0: shutil.rmtree(DATAREPO_ROOT) else: print >> sys.stderr, "Tests failed; not cleaning up %s" % os.path.abspath(DATAREPO_ROOT) else: print >> sys.stderr, "CLEANUP_DATAREPO is False; not cleaning up %s" % \ os.path.abspath(DATAREPO_ROOT) if shouldExit: sys.exit(status) return status
def run(shouldExit = False): utilsTests.run(suite(), shouldExit)
def run(shouldExit=False): """Run the tests""" tests.run(suite(), shouldExit)
def run(exit = False): """Run the tests""" tests.run(suite(), exit)
def run(exit=False): utilsTests.run(suite(), exit)
def run(doExit=False): """Run the tests""" utilsTests.run(suite(), doExit)
def run(doExit=False): """Run the tests""" if dataDir == None: return utilsTests.run(suite(), doExit)
def run(shouldExit=False): """Run the tests. """ utilsTests.run(suite(), shouldExit)
def testPolicyCopy(self): p = Policy.createPolicy("examples/EventTransmitter_policy.paf") pp = Policy(p, True) self.assertEquals(p.get("transmitter.serializationFormat"), "deluxe") self.assertEquals(pp.getString("transmitter.serializationFormat"), "deluxe") p = None self.assertEquals(pp.getString("transmitter.serializationFormat"), "deluxe") def testSetNothing(self): p = Policy() try: p.set("foo", None) self.assert_(False, "Setting value to None succeeded.") except RuntimeError: self.assertFalse(p.exists("foo")) #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- def suite(): """Returns a suite containing all the test cases in this module.""" tests.init() suites = [] suites += unittest.makeSuite(PolicyTestCase) suites += unittest.makeSuite(tests.MemoryTestCase) return unittest.TestSuite(suites) if __name__ == "__main__": tests.run(suite())
def run(): """Run the tests""" utilsTests.run(suite())
def run(exit=False): """Run the tests""" return utilsTests.run(suite(), exit)
def run(): tests.init() suites = [] suites.append(unittest.makeSuite(DbAuthTestCase)) suites.append(unittest.makeSuite(tests.MemoryTestCase)) tests.run(unittest.TestSuite(suites))
tester.setDebugVerbosity(5) keysToPublish = policy.getArray("keysToPublish") clipboard = {} for key in keysToPublish: key = stage._parseKeysToPublish(key)[1] clipboard[key] = PropertySet() clipboard[key].setString("foo", "bar") self.assertRaises(lss.pex.exceptions.Exception, tester.runMaster, clipboard) stage.setEventBrokerHost("lsst4.ncsa.uiuc.edu") clipboard = tester.runMaster(clipboard) #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- def suite(): """Returns a suite containing all the test cases in this module.""" tests.init() suites = [] suites += unittest.makeSuite(EventStageTestCase) return unittest.TestSuite(suites) if __name__ == "__main__": tests.run(suite())
def run(exit=False): ''' Run the utilsTests ''' utilsTests.run(suite(), exit)
afwMath.randomPoissonImage(maskedImage.getImage(), rand, mu) maskedImage.getVariance().set(mu) weightList.append(weight) self.reportBadPixels(maskedImage, badPixelMask) print "Stack: ", coaddMaskedImage = afwMath.statisticsStack( maskedImageList, afwMath.MEANCLIP, statsCtrl, weightList) self.reportBadPixels(coaddMaskedImage, badPixelMask) #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- def suite(): """Returns a suite containing all the test cases in this module.""" utilsTests.init() suites = [] suites += unittest.makeSuite(weightedStatsBugTestCase) suites += unittest.makeSuite(utilsTests.MemoryTestCase) return unittest.TestSuite(suites) if __name__ == "__main__": utilsTests.run(suite())
def run(shouldExit=False): """Run the tests""" random.seed(123456789) utilsTests.run(suite(), shouldExit)
def run(shouldExit = False): """Run the tests """ if AfwdataDir is None: print "Warning: afwdata is not setup so some tests will be skipped" utilsTests.run(suite(), shouldExit)
""" utilsTests.init() suites = [ unittest.makeSuite(ScaleLsstSimZeroPointTaskTestCase), unittest.makeSuite(utilsTests.MemoryTestCase), ] return unittest.TestSuite(suites) def run(shouldExit=False): """Run the tests""" config = SpatialScaleZeroPointTask.ConfigClass() config.selectFluxMag0.retarget(SelectLsstSimFluxMag0Task) print config try: DbAuth.username(config.selectFluxMag0.host, str(config.selectFluxMag0.port)), except Exception, e: print "Warning: did not find host=%s, port=%s in your db-auth file; or %s " \ "skipping unit tests" % \ (config.selectFluxMag0.host, str(config.selectFluxMag0.port), e) return utilsTests.run(suite(), shouldExit) if __name__ == "__main__": run(True)
def run(shouldExit=False): """Run the tests""" utilsTests.run(suite(), shouldExit)
def run(exit=False): """Run the tests""" tests.run(suite(), exit)
def run(exit=False): """Run the utilsTests""" utilsTests.run(suite(), exit)
def run(exit=False): """Run the tests""" if display: ds9.setDefaultFrame(0) utilsTests.run(suite(), exit)
def run(shouldExit = False): utilsTests.run(suite(),shouldExit)
initialParameters, stepsize, measurements, variances, xPositions, yPositions, 0.1, ) print "modelParams=", modelParams print "fitParams =", fitResults.parameterList self.assert_(fitResults.isValid, "fit failed") if not numpy.allclose(modelParams, fitResults.parameterList): self.fail("fit not accurate") #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- def suite(): """Returns a suite containing all the test cases in this module.""" utilsTests.init() suites = [] suites += unittest.makeSuite(MinimizeTestCase) suites += unittest.makeSuite(utilsTests.MemoryTestCase) return unittest.TestSuite(suites) if __name__ == "__main__": utilsTests.run(suite())