def test_get_unstaged_changes(self):
     """Test get_unstaged_changes()."""
     with open(os.path.join(self.tempdir, 'spam'), 'w') as f:
         f.write('a\n')
     os.remove(os.path.join(self.tempdir, 'foo'))
     repo = git_metrics._GitRepo(self.git_dir)
     added, removed = repo.get_unstaged_changes()
     self.assertEqual(added, 0)  # Does not count untracked files
     self.assertEqual(removed, 3)
 def test_get_commit_time(self):
     """Test get_commit_time()."""
     repo = git_metrics._GitRepo(self.git_dir)
     got = repo.get_commit_time()
     self.assertEqual(got, 1483228800)
 def test_get_commit_hash(self):
     """Test get_commit_hash()."""
     repo = git_metrics._GitRepo(self.git_dir)
     got = repo.get_commit_hash()
     self.assertEqual(got, '7c88f131e520e8455e2403b88ff4f723758c5dd6')