Exemple #1
0
 def testLengthErrors(self):
     for name, value in self.argDict.items():
         if not isinstance(value, tuple):
             continue
         argDict = self.argDict.copy()
         argDict[name] = value[0:-1]  # too few values
         with self.assertRaises(ValueError):
             CoordinateConverterConfig(**argDict)
         argDict[name] = value + (3.1, )  # too many values
         with self.assertRaises(ValueError):
             CoordinateConverterConfig(**argDict)
Exemple #2
0
 def testScaleErrors(self):
     """Rotator and azimuth scales must be ±1 degree
     """
     for name in ("telAzimuthScale", "telRotScale", "cbpAzimuthScale"):
         argDict = self.argDict.copy()
         argDict[name] = 1.01
         with self.assertRaises(ValueError):
             CoordinateConverterConfig(**argDict)
Exemple #3
0
 def testDefaults(self):
     argDict = self.argDict
     minimalArgDict = argDict.copy()
     defaultArgDict = dict(
         telAltitudeOffsetDeg=0,
         telAltitudeScale=1,
         cbpAltitudeOffsetDeg=0,
         cbpAltitudeScale=1,
     )
     for name in defaultArgDict:
         del minimalArgDict[name]
         argDict[name] = defaultArgDict[name]
     config = CoordinateConverterConfig(**minimalArgDict)
     self.checkValues(argDict, config)
Exemple #4
0
 def testBasics(self):
     argDict = self.argDict
     config = CoordinateConverterConfig(**argDict)
     self.checkValues(argDict, config)