code: def test_environment_ls(self):
      self.__set_variables()
      self.environment_command.parse(["environment", "create"])
      created_environment_obj = self.environment_command.execute()
  
      # Test success (defaults)
      self.environment_command.parse(["environment", "ls"])
      environment_objs = self.environment_command.execute()
      assert created_environment_obj in environment_objs
  
      # Test failure (format)
      failed = False
      try:
          self.environment_command.parse(
              ["environment", "ls", "--format"]
          )
      except ArgumentError:
          failed = True
      assert failed
  
      # Test success format csv
      self.environment_command.parse(
          ["environment", "ls", "--format", "csv"]
      )
      environment_objs = self.environment_command.execute()
      assert created_environment_obj in environment_objs
  
      # Test success format csv, download default
      self.environment_command.parse(
          ["environment", "ls", "--format", "csv", "--download"]
      )
      environment_objs = self.environment_command.execute()
      assert created_environment_obj in environment_objs
      test_wildcard = os.path.join(
          self.project_command.project_controller.home,
          "environment_ls_*",
      )
      paths = [n for n in glob.glob(test_wildcard) if os.path.isfile(n)]
      assert paths
      assert open(paths[0], "r").read()
      os.remove(paths[0])
  
      # Test success format csv, download exact path
      test_path = os.path.join(self.temp_dir, "my_output")
      self.environment_command.parse(
          [
              "environment",
              "ls",
              "--format",
              "csv",
              "--download",
              "--download-path",
              test_path,
          ]
      )
      environment_objs = self.environment_command.execute()
      assert created_environment_obj in environment_objs
      assert os.path.isfile(test_path)
      assert open(test_path, "r").read()
      os.remove(test_path)
  
      # Test success format table
      self.environment_command.parse(["environment", "ls"])
      environment_objs = self.environment_command.execute()
      assert created_environment_obj in environment_objs
  
      # Test success format table, download default
      self.environment_command.parse(
          ["environment", "ls", "--download"]
      )
      environment_objs = self.environment_command.execute()
      assert created_environment_obj in environment_objs
      test_wildcard = os.path.join(
          self.project_command.project_controller.home,
          "environment_ls_*",
      )
      paths = [n for n in glob.glob(test_wildcard) if os.path.isfile(n)]
      assert paths
      assert open(paths[0], "r").read()
      os.remove(paths[0])
  
      # Test success format table, download exact path
      test_path = os.path.join(self.temp_dir, "my_output")
      self.environment_command.parse(
          [
              "environment",
              "ls",
              "--download",
              "--download-path",
              test_path,
          ]
      )
      environment_objs = self.environment_command.execute()
      assert created_environment_obj in environment_objs
      assert os.path.isfile(test_path)
      assert open(test_path, "r").read()
      os.remove(test_path)
  
imports: from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import os
  import glob
  import time
  import pytest
  import uuid
  import tempfile
  import shutil
  import platform
  from argparse import ArgumentError
  from datmo.cli.driver.helper import Helper
  from datmo.cli.command.environment import EnvironmentCommand
  from datmo.cli.command.project import ProjectCommand
  from datmo.core.util.misc_functions import pytest_docker_environment_failed_instantiation
  from datmo.config import Config
  from datmo.core.util.exceptions import EnvironmentDoesNotExist
label_desc: Use image node_id 9 for calling the TestEnvironmentCommand obj's underlying member method code with example usage: obj.test_environment_ls() without return types