diff options
Diffstat (limited to 'git/test/test_docs.py')
-rw-r--r-- | git/test/test_docs.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/git/test/test_docs.py b/git/test/test_docs.py new file mode 100644 index 00000000..5ebae513 --- /dev/null +++ b/git/test/test_docs.py @@ -0,0 +1,26 @@ +#-*-coding:utf-8-*- +# test_git.py +# Copyright (C) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors +# +# This module is part of GitPython and is released under +# the BSD License: http://www.opensource.org/licenses/bsd-license.php +import os + +import git +from git.test.lib import TestBase +from gitdb.test.lib import with_rw_directory +from git.repo.fun import touch + + +class TestGit(TestBase): + + @with_rw_directory + def test_add_file_and_commit(self, rw_dir): + repo_dir = os.path.join(rw_dir, 'my-new-repo') + file_name = os.path.join(repo_dir, 'new-file') + + r = git.Repo.init(repo_dir) + # This function just creates an empty file ... + touch(file_name) + r.index.add([file_name]) + r.index.commit("initial commit") |