class_docstr: Checks all functions of the GitCodeDriver
class_docstr_tok: ["Checks","all","functions","of","the","GitCodeDriver"]
code: def test_latest_ref(self):
      self.git_code_manager.init()
      # Test success (single commit)
      test_filepath = os.path.join(
          self.git_code_manager.filepath, "test.txt"
      )
      with open(test_filepath, "wb") as f:
          f.write(to_bytes(str("test")))
      commit_hash = self.git_code_manager.create_ref()
      result = self.git_code_manager.latest_ref()
      assert result == commit_hash
      # Test success (multiple commits)
      test_filepath = os.path.join(
          self.git_code_manager.filepath, "test2.txt"
      )
      with open(test_filepath, "wb") as f:
          f.write(to_bytes(str("test")))
      time.sleep(1)
      commit_hash_2 = self.git_code_manager.create_ref()
      result = self.git_code_manager.latest_ref()
      assert commit_hash != commit_hash_2
      assert result == commit_hash_2
      # Test success (checkout)
      self.git_code_manager.checkout_ref(commit_id=commit_hash)
      result = self.git_code_manager.current_hash()
      assert result == commit_hash
  
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.git import GitCodeDriver, GitHostDriver
  from datmo.core.util.exceptions import CommitFailed, CommitDoesNotExist, PathDoesNotExist, GitExecutionError, DatmoFolderInWorkTree, UnstagedChanges
label_desc: Use image node_id 13 for calling the TestGitCodeDriver obj's underlying member method code with example usage: obj.test_latest_ref() without return types