class_docstr: Checks all functions of the DockerEnvironmentDriver
class_docstr_tok: ["Checks","all","functions","of","the","DockerEnvironmentDriver"]
code: def test_create_requirements_file(self):
      # 1) Test failure EnvironmentDoesNotExist
      # 2) Test success
      # 3) Test failure EnvironmentRequirementsCreateError
      # 1) Test option 1
      result = self.docker_environment_driver.create_requirements_file()
      assert (
          os.path.isfile(result) and "datmo" in open(result, "r").read()
      )
  
      # 2) Test option 2
      # Since it uses pip as package manager, it doesn't extract any other package than what
      # has already been installed in local
      script_path = os.path.join(
          self.docker_environment_driver.root, "script.py"
      )
      with open(script_path, "wb") as f:
          f.write(to_bytes("import numpy\n"))
          f.write(to_bytes("import sklearn\n"))
      # Test default
      result = self.docker_environment_driver.create_requirements_file()
      assert result
      assert (
          os.path.isfile(result) and "datmo" in open(result, "r").read()
      )
  
      # 3) Test option 3
      exception_thrown = False
      try:
          _ = self.docker_environment_driver.create_requirements_file(
              package_manager="does_not_work"
          )
      except EnvironmentRequirementsCreateError:
          exception_thrown = True
  
      assert exception_thrown
  
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 36 for calling the TestDockerEnv obj's underlying member method code with example usage: obj.test_create_requirements_file() without return types