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)
Exemplo n.º 2
0
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)
Exemplo n.º 4
0
Arquivo: angle.py Projeto: lsst-dm/bp
def run(shouldExit=False):
    """Run the tests"""
    tests.run(suite(), shouldExit)
Exemplo n.º 5
0
def run(exit = False):
    """Run the tests"""
    tests.run(suite(), exit)
Exemplo n.º 6
0
def run(exit=False):
    utilsTests.run(suite(), exit)
Exemplo n.º 7
0
def run(doExit=False):
    """Run the tests"""
    utilsTests.run(suite(), doExit)
Exemplo n.º 8
0
def run(doExit=False):
    """Run the tests"""
    if dataDir == None:
        return
    utilsTests.run(suite(), doExit)
Exemplo n.º 9
0
def run(shouldExit=False):
    """Run the tests.
    """
    utilsTests.run(suite(), shouldExit)
Exemplo n.º 10
0
    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())
Exemplo n.º 11
0
def run():
    """Run the tests"""
    utilsTests.run(suite())
Exemplo n.º 12
0
def run(exit=False):
    """Run the tests"""
    return utilsTests.run(suite(), exit)
Exemplo n.º 13
0
def run(exit=False):
    utilsTests.run(suite(), exit)
Exemplo n.º 14
0
def run():
    tests.init()
    suites = []
    suites.append(unittest.makeSuite(DbAuthTestCase))
    suites.append(unittest.makeSuite(tests.MemoryTestCase))
    tests.run(unittest.TestSuite(suites))
Exemplo n.º 15
0
        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())
Exemplo n.º 16
0
def run(exit=False):
    '''
    Run the utilsTests
    '''
    utilsTests.run(suite(), exit)
Exemplo n.º 17
0
                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())
Exemplo n.º 18
0
def run(exit=False):
    '''
    Run the utilsTests
    '''
    utilsTests.run(suite(), exit)
Exemplo n.º 19
0
def run(shouldExit=False):
    """Run the tests"""
    random.seed(123456789)
    utilsTests.run(suite(), shouldExit)
Exemplo n.º 20
0
def run():
    """Run the tests"""
    utilsTests.run(suite())
Exemplo n.º 21
0
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)
Exemplo n.º 23
0
def run(doExit=False):
    """Run the tests"""
    utilsTests.run(suite(), doExit)
Exemplo n.º 24
0
def run(doExit=False):
    """Run the tests"""
    if dataDir == None:
        return
    utilsTests.run(suite(), doExit)
Exemplo n.º 25
0
def run(shouldExit=False):
    """Run the tests"""
    utilsTests.run(suite(), shouldExit)
Exemplo n.º 26
0
def run(exit=False):
    """Run the tests"""
    tests.run(suite(), exit)
Exemplo n.º 27
0
def run(exit=False):
    """Run the utilsTests"""
    utilsTests.run(suite(), exit)
Exemplo n.º 28
0
def run(exit=False):
    """Run the tests"""

    if display:
        ds9.setDefaultFrame(0)
    utilsTests.run(suite(), exit)
Exemplo n.º 29
0
def run(exit=False):
    """Run the utilsTests"""
    utilsTests.run(suite(), exit)
Exemplo n.º 30
0
def run(shouldExit = False):
    utilsTests.run(suite(),shouldExit)
Exemplo n.º 31
0
            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())
Exemplo n.º 32
0
def run(shouldExit=False):
    """Run the tests"""
    random.seed(123456789)
    utilsTests.run(suite(), shouldExit)