class_docstr: Checks all functions of the DockerEnvironmentDriver
class_docstr_tok: ["Checks","all","functions","of","the","DockerEnvironmentDriver"]
code: def test_setup(self):
      save_definition_path = os.path.join(
          self.docker_environment_driver.root, "test"
      )
  
      # Test setup failure if name it not present
      failed = False
      try:
          _ = self.docker_environment_driver.setup(
              options={}, definition_path=save_definition_path
          )
      except EnvironmentDoesNotExist:
          failed = True
      assert failed
  
      # Test setup failure if name is not a valid name
      failed = False
      try:
          _ = self.docker_environment_driver.setup(
              options={"name": "random"},
              definition_path=save_definition_path,
          )
      except EnvironmentDoesNotExist:
          failed = True
      assert failed
  
      options = {
          "environment_framework": "data-analytics",
          "environment_type": "cpu",
          "environment_language": "py27",
      }
  
      # Test if failure if the path does not exist
      failed = False
      try:
          _ = self.docker_environment_driver.setup(
              options=options, definition_path=save_definition_path
          )
      except PathDoesNotExist:
          failed = True
      assert failed
  
      # Create definition path
      os.makedirs(save_definition_path)
  
      # Test by passing definition filepath and options
      result = self.docker_environment_driver.setup(
          options=options, definition_path=save_definition_path
      )
      definition_filepath = os.path.join(
          save_definition_path, "Dockerfile"
      )
      assert (
          result
          and os.path.isfile(definition_filepath)
          and "datmo" in open(definition_filepath, "r").read()
      )
  
imports: from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import os
  import shutil
  import tempfile
  import platform
  import threading
  import sys
  import uuid
  import timeout_decorator
  from io import open
  from datmo.core.controller.environment.driver.dockerenv import DockerEnvironmentDriver
  from datmo.core.util.exceptions import EnvironmentInitFailed, EnvironmentConnectFailed, FileAlreadyExistsError, EnvironmentRequirementsCreateError, EnvironmentImageNotFound, EnvironmentContainerNotFound, PathDoesNotExist, EnvironmentDoesNotExist, EnvironmentExecutionError
  from datmo.core.util.misc_functions import check_docker_inactive, pytest_docker_environment_failed_instantiation
label_desc: Use image node_id 15 for calling the TestDockerEnv obj's underlying member method code with example usage: obj.test_setup() without return types