code: def test_package_validates_compiled():
      sagemaker_session.wait_for_edge_packaging_job = Mock(
          return_value=DESCRIBE_EDGE_PACKAGING_JOB_RESPONSE
      )
      sagemaker_session.package_model_for_edge = Mock()
      model = _create_model()
      model._compilation_job_name = None
  
      with pytest.raises(ValueError) as e:
          model.package_for_edge(
              output_path="s3://output",
              role="role",
              model_name="model_name",
              model_version="1.0",
          )
  
      assert "You must first compile this model" in str(e)
  
imports: from __future__ import absolute_import
  import pytest
  from mock import Mock
  from sagemaker.model import Model
label_desc: Use image node_id 4 for calling a global function with example usage: test_package_validates_compiled() without return types