def test_from_dict(self): m = MethodModel.from_dict(self.serialized) assert m.takes.to_dict() == self.takes.to_dict() assert m.defaults == self.serialized["defaults"] assert m.tags == [] assert m.writeable is False assert m.label == "" assert m.returns.to_dict() == MapMeta().to_dict()
def update_configure_args(self, part, configure_model): """Tell controller part needs different things passed to Configure""" with self.changes_squashed: # Update the dict self.configure_method_models[part] = configure_model method_models = list(self.configure_method_models.values()) # Update takes with the things we need default_configure = MethodModel.from_dict( RunnableController.configure.MethodModel.to_dict()) default_configure.defaults["axesToMove"] = self.axes_to_move.value method_models.append(default_configure) # Decorate validate and configure with the sum of its parts self._block.validate.recreate_from_others(method_models) self._block.validate.set_returns(self._block.validate.takes) self._block.configure.recreate_from_others(method_models)