Пример #1
0
class TestWEPCalculationFactory(unittest.TestCase):
    """Test the WEPCalculationFactory class."""
    def setUp(self):

        self.wepCalculationFactory = WEPCalculationFactory()

    def testGetCalculatorOfLsstCam(self):

        calculator = self.wepCalculationFactory.getCalculator(CamType.LsstCam)

        self.assertTrue(isinstance(calculator, WEPCalculationOfLsstCam))

    def testGetCalculatorOfLsstFamCam(self):

        calculator = self.wepCalculationFactory.getCalculator(
            CamType.LsstFamCam)

        self.assertTrue(isinstance(calculator, WEPCalculationOfLsstFamCam))

    def testGetCalculatorOfComCam(self):

        calculator = self.wepCalculationFactory.getCalculator(CamType.ComCam)

        self.assertTrue(isinstance(calculator, WEPCalculationOfComCam))

    def testGetCalculatorOfWrongCamType(self):

        self.assertRaises(ValueError, self.wepCalculationFactory.getCalculator,
                          "wrongInst")
Пример #2
0
def _prepareWepCalc(isrDirPath, filterType, raInDeg, decInDeg, rotAngInDeg,
                    isEimg):

    wepCalc = WEPCalculationFactory.getCalculator(CamType.ComCam, isrDirPath)
    wepCalc.setFilter(filterType)
    wepCalc.setBoresight(raInDeg, decInDeg)
    wepCalc.setRotAng(rotAngInDeg)

    if (isEimg):
        settingFile = wepCalc.getSettingFile()
        settingFile.updateSetting("imageType", "eimage")

    return wepCalc
Пример #3
0
    def testGetCalculatorOfComCam(self):

        calculator = WEPCalculationFactory.getCalculator(CamType.ComCam, "")

        self.assertTrue(isinstance(calculator, WEPCalculationOfComCam))
Пример #4
0
    def setUp(self):

        self.wepCalculationFactory = WEPCalculationFactory()
Пример #5
0
    def testGetCalculatorOfComCam(self):

        calculator = WEPCalculationFactory.getCalculator(CamType.ComCam, "")

        self.assertTrue(isinstance(calculator, WEPCalculationOfComCam))