text: import os
  import unittest
  import uuid
  
  import papermill
  
  from tests import datasets, server
  
  EXPERIMENT_ID = str(uuid.uuid4())
  OPERATOR_ID = str(uuid.uuid4())
  RUN_ID = str(uuid.uuid4())
  
  
  class TestFeatureTools(unittest.TestCase):
  
      def setUp(self):
          # Set environment variables needed to run notebooks
          os.environ["EXPERIMENT_ID"] = EXPERIMENT_ID
          os.environ["OPERATOR_ID"] = OPERATOR_ID
          os.environ["RUN_ID"] = RUN_ID
  
          datasets.iris()
          datasets.hotel_bookings()
  
          os.chdir("tasks/feature-tools")
  
      def tearDown(self):
          datasets.clean()
          os.chdir("../../")
  
      def test_experiment_iris(self):
          papermill.execute_notebook(
              "Experiment.ipynb",
              "/dev/null",
              parameters=dict(
                  dataset="/tmp/data/iris.csv",
                  target="Species",
                  date=None,
                  group=["SepalLengthCm"],
              ),
          )
  
          papermill.execute_notebook(
              "Deployment.ipynb",
              "/dev/null",
          )
          data = datasets.iris_testdata()
          with server.Server() as s:
              response = s.test(data=data)
          names = response["names"]
          ndarray = response["ndarray"]
          self.assertEqual(len(ndarray[0]), 4)  # 4 features
          self.assertEqual(len(names), 4)
  
      def test_experiment_hotel_bookings(self):
          papermill.execute_notebook(
              "Experiment.ipynb",
              "/dev/null",
              parameters=dict(
                  dataset="/tmp/data/hotel_bookings.csv",
                  target="is_canceled",
                  date="reservation_status_date",
                  group=["hotel"],
              ),
          )
  
          papermill.execute_notebook(
              "Deployment.ipynb",
              "/dev/null",
          )
          data = datasets.hotel_bookings_testdata()
          with server.Server() as s:
              response = s.test(data=data)
          names = response["names"]
          ndarray = response["ndarray"]
          self.assertEqual(len(ndarray[0]), 31)  # 31 features
          self.assertEqual(len(names), 31)
  