Example #1
0
 def deserialize_hook(self, pairs):
     d = OrderedDict(pairs)
     if "timeStamp" in d:
         d["timeStamp"] = d["timeStamp"]["secondsPastEpoch"] + \
             float(d["timeStamp"]["nanoseconds"]) * 1e-9
     if "name" in d and "version" in d and d["name"].startswith("V"):
         typ = VType.subclasses()[d["name"]]
         if typ == VEnum:
             d = typ(d["labels"])
         else:
             d = typ
     return d
Example #2
0
 def test_all_subclasses(self):
     self.assertIn(VDouble, VType.subclasses().values())
     self.assertNotIn(VNumber, VType.subclasses().values())