class_docstr: Checks all functions of the FileCodeDriver
class_docstr_tok: ["Checks","all","functions","of","the","FileCodeDriver"]
code: def test_create_ref(self):
      # Test failure, not initialized
      failed = False
      try:
          self.file_code_driver.create_ref()
      except CodeNotInitialized:
          failed = True
      assert failed
      # Test failure, commit given does not exist
      self.file_code_driver.init()
      failed = False
      try:
          self.file_code_driver.create_ref(commit_id="random")
      except CommitDoesNotExist:
          failed = True
      assert failed
      # Test successful creation of ref
      self.__setup()
      result = self.file_code_driver.create_ref()
      assert result == "69a329523ce1ec88bf63061863d9cb14"
      # Assert the commit file was added in the correct place
      commit_filepath = os.path.join(
          self.file_code_driver._code_filepath, result
      )
      assert os.path.isfile(commit_filepath)
      # Assert only the tracked files were added in the correct locations
      tracked_filepaths = self.file_code_driver._get_tracked_files()
      for tracked_filepath in tracked_filepaths:
          absolute_dirpath = os.path.join(
              self.file_code_driver._code_filepath, tracked_filepath
          )
          assert os.path.isdir(absolute_dirpath)
          assert len(os.listdir(absolute_dirpath)) == 1
          file_line_str = (
              tracked_filepath + "," + os.listdir(absolute_dirpath)[0]
          )
          assert file_line_str in open(commit_filepath).read()
  
imports: from __future__ import division
  from __future__ import unicode_literals
  import os
  import time
  import shutil
  import tempfile
  import platform
  from io import open
  from datmo.core.controller.code.driver.file import FileCodeDriver
  from datmo.core.util.exceptions import PathDoesNotExist, FileIOError, CodeNotInitialized, UnstagedChanges, CommitDoesNotExist
label_desc: Use image node_id 12 for calling the TestFileCodeDriver obj's underlying member method code with example usage: obj.test_create_ref() without return types