code: def test_create(self):
      # check project is not initialized if wrong home
      Config().set_home(os.path.join("does", "not", "exist"))
      failed = False
      try:
          create(message="test")
      except InvalidProjectPath:
          failed = True
      assert failed
  
      # Create a snapshot with default params
      # (pass w/ no commit)
      Config().set_home(self.temp_dir)
      result = create(message="test")
      assert result
  
      # Create a snapshot with default params and files to commit
      test_filepath = os.path.join(self.temp_dir, "script.py")
      with open(test_filepath, "wb") as f:
          f.write(to_bytes("import numpy\n"))
          f.write(to_bytes("import sklearn\n"))
  
      snapshot_obj_1 = create(message="test")
  
      assert snapshot_obj_1
      assert isinstance(snapshot_obj_1, Snapshot)
      assert snapshot_obj_1.message == "test"
      assert snapshot_obj_1.code_id
      assert snapshot_obj_1.environment_id
      assert snapshot_obj_1.files == []
      assert snapshot_obj_1.config == {}
      assert snapshot_obj_1.stats == {}
  
      # Create a snapshot with default params, files, and environment
      test_filepath = os.path.join(self.temp_dir, "Dockerfile")
      with open(test_filepath, "wb") as f:
          f.write(to_bytes("FROM python:3.5-alpine"))
      snapshot_obj_2 = create(message="test")
  
      assert snapshot_obj_2
      assert isinstance(snapshot_obj_2, Snapshot)
      assert snapshot_obj_2.message == "test"
      assert snapshot_obj_2.code_id
      assert snapshot_obj_2.environment_id
      assert snapshot_obj_2.files == []
      assert snapshot_obj_2.config == {}
      assert snapshot_obj_2.stats == {}
      assert snapshot_obj_2 != snapshot_obj_1
  
      # Create a snapshot with default params, files, and environment being passed in
      test_filepath = os.path.join(self.temp_dir, "Dockerfile")
      with open(test_filepath, "wb") as f:
          f.write(to_bytes("FROM python:3.5-alpine"))
      snapshot_obj_3 = create(message="test", env=test_filepath)
  
      assert snapshot_obj_3
      assert isinstance(snapshot_obj_3, Snapshot)
      assert snapshot_obj_3.message == "test"
      assert snapshot_obj_3.code_id
      assert snapshot_obj_3.environment_id
      assert snapshot_obj_3.files == []
      assert snapshot_obj_3.config == {}
      assert snapshot_obj_3.stats == {}
      assert snapshot_obj_3 != snapshot_obj_1
  
imports: import os
  import tempfile
  import platform
  from io import open, TextIOWrapper
  from datmo.snapshot import create, ls, update, delete
  from datmo.config import Config
  from datmo.snapshot import Snapshot
  from datmo.core.entity.snapshot import Snapshot
  from datmo.core.controller.project import ProjectController
  from datmo.core.controller.task import TaskController
  from datmo.core.util.exceptions import InvalidProjectPath, SnapshotCreateFromTaskArgs, EntityNotFound, DoesNotExist
  from datmo.core.util.misc_functions import pytest_docker_environment_failed_instantiation
label_desc: Use image node_id 4 for calling the TestSnapshotModule obj's underlying member method code with example usage: obj.test_create() without return types