def test_save_spec_api(self):
        """
        save an mlpackage using the save_spec API. Reload the model from disk and verify it works
        """
        spec = self.mlmodel.get_spec()
        with tempfile.TemporaryDirectory(
            suffix=utils._MLPACKAGE_EXTENSION
        ) as model_path:
            utils.save_spec(spec, model_path, weights_dir=self.mlmodel.weights_dir)
            model = MLModel(model_path)
            self._test_mlmodel_correctness(model)

        save an mlpackage using the save_spec API. Reload the model from disk and verify it works
        
coremltools/test/modelpackage/test_modelpackage.py