summaryrefslogtreecommitdiff
path: root/test/git
diff options
context:
space:
mode:
Diffstat (limited to 'test/git')
-rw-r--r--test/git/test_actor.py2
-rw-r--r--test/git/test_blob.py2
-rw-r--r--test/git/test_commit.py2
-rw-r--r--test/git/test_diff.py2
-rw-r--r--test/git/test_git.py25
-rw-r--r--test/git/test_head.py2
-rw-r--r--test/git/test_repo.py2
-rw-r--r--test/git/test_stats.py2
-rw-r--r--test/git/test_tag.py2
-rw-r--r--test/git/test_tree.py2
-rw-r--r--test/git/test_utils.py17
11 files changed, 20 insertions, 40 deletions
diff --git a/test/git/test_actor.py b/test/git/test_actor.py
index 14b78f19..7468c3ff 100644
--- a/test/git/test_actor.py
+++ b/test/git/test_actor.py
@@ -1,6 +1,6 @@
import os
from test.testlib import *
-from git_python import *
+from git import *
class TestActor(object):
def test_from_string_should_separate_name_and_email(self):
diff --git a/test/git/test_blob.py b/test/git/test_blob.py
index ee546ab4..05d68285 100644
--- a/test/git/test_blob.py
+++ b/test/git/test_blob.py
@@ -1,6 +1,6 @@
import time
from test.testlib import *
-from git_python import *
+from git import *
class TestBlob(object):
def setup(self):
diff --git a/test/git/test_commit.py b/test/git/test_commit.py
index 65e92812..44b24c82 100644
--- a/test/git/test_commit.py
+++ b/test/git/test_commit.py
@@ -1,5 +1,5 @@
from test.testlib import *
-from git_python import *
+from git import *
class TestCommit(object):
def setup(self):
diff --git a/test/git/test_diff.py b/test/git/test_diff.py
index b605eddd..7b24cd97 100644
--- a/test/git/test_diff.py
+++ b/test/git/test_diff.py
@@ -1,5 +1,5 @@
from test.testlib import *
-from git_python import *
+from git import *
class TestDiff(object):
def setup(self):
diff --git a/test/git/test_git.py b/test/git/test_git.py
index c20ea7b5..e358d01b 100644
--- a/test/git/test_git.py
+++ b/test/git/test_git.py
@@ -1,7 +1,6 @@
import os
from test.testlib import *
-from git_python import Git
-from git_python import errors
+from git import Git, GitCommandError
class TestGit(object):
def setup(self):
@@ -30,28 +29,24 @@ class TestGit(object):
def test_it_accepts_stdin(self):
filename = fixture_path("cat_file_blob")
fh = open(filename, 'r')
- assert_equal( "70c379b63ffa0795fdbfbc128e5a2818397b7ef8",
- self.git.hash_object(istream=fh, stdin=True) )
+ assert_equal("70c379b63ffa0795fdbfbc128e5a2818397b7ef8",
+ self.git.hash_object(istream=fh, stdin=True))
fh.close()
def test_it_returns_status_and_ignores_stderr(self):
- assert_equal( (1, ""), self.git.this_does_not_exist(with_status=True) )
+ assert_equal((1, ""), self.git.this_does_not_exist(with_status=True))
+ @raises(GitCommandError)
def test_it_raises_errors(self):
- error_raised = False
- try:
- self.git.this_does_not_exist(with_exceptions=True)
- except errors.GitCommandError, e:
- error_raised = True
- assert_equal( True, error_raised )
+ self.git.this_does_not_exist(with_exceptions=True)
def test_it_returns_stderr_in_output(self):
# Note: no trailiing newline
- assert_equal( "git: 'this-does-not-exist' is not a git-command. See 'git --help'.",
- self.git.this_does_not_exist(with_stderr=True) )
+ assert_match(r"^git: 'this-does-not-exist' is not a git-command",
+ self.git.this_does_not_exist(with_stderr=True))
def test_it_does_not_strip_output_when_using_with_raw_output(self):
# Note: trailing newline
- assert_equal( "git: 'this-does-not-exist' is not a git-command. See 'git --help'." + os.linesep,
+ assert_match(r"^git: 'this-does-not-exist' is not a git-command" + os.linesep,
self.git.this_does_not_exist(with_stderr=True,
- with_raw_output=True) )
+ with_raw_output=True))
diff --git a/test/git/test_head.py b/test/git/test_head.py
index 47cfb608..0e5592d3 100644
--- a/test/git/test_head.py
+++ b/test/git/test_head.py
@@ -1,5 +1,5 @@
from test.testlib import *
-from git_python import *
+from git import *
class TestHead(object):
def setup(self):
diff --git a/test/git/test_repo.py b/test/git/test_repo.py
index 9a50e713..3f7196be 100644
--- a/test/git/test_repo.py
+++ b/test/git/test_repo.py
@@ -1,7 +1,7 @@
import os
import time
from test.testlib import *
-from git_python import *
+from git import *
class TestRepo(object):
def setup(self):
diff --git a/test/git/test_stats.py b/test/git/test_stats.py
index 4926ac4f..abe129a8 100644
--- a/test/git/test_stats.py
+++ b/test/git/test_stats.py
@@ -1,5 +1,5 @@
from test.testlib import *
-from git_python import *
+from git import *
class TestStats(object):
def setup(self):
diff --git a/test/git/test_tag.py b/test/git/test_tag.py
index e882f5e7..30311f52 100644
--- a/test/git/test_tag.py
+++ b/test/git/test_tag.py
@@ -1,6 +1,6 @@
from mock import *
from test.testlib import *
-from git_python import *
+from git import *
class TestTag(object):
def setup(self):
diff --git a/test/git/test_tree.py b/test/git/test_tree.py
index 0550e410..e91e57ba 100644
--- a/test/git/test_tree.py
+++ b/test/git/test_tree.py
@@ -1,5 +1,5 @@
from test.testlib import *
-from git_python import *
+from git import *
class TestTree(object):
def setup(self):
diff --git a/test/git/test_utils.py b/test/git/test_utils.py
index b6eee00a..b8fcfb3e 100644
--- a/test/git/test_utils.py
+++ b/test/git/test_utils.py
@@ -1,6 +1,6 @@
import os
from test.testlib import *
-from git_python import *
+from git import *
class TestUtils(object):
def setup(self):
@@ -13,18 +13,3 @@ class TestUtils(object):
def test_it_should_dashify(self):
assert_equal('this-is-my-argument', dashify('this_is_my_argument'))
assert_equal('foo', dashify('foo'))
-
- def test_pop_key_array(self):
- array = pop_key(self.testdict, "array")
- assert_equal( [ 42 ], array )
- assert_equal( False, "array" in self.testdict )
-
- def test_pop_key_string(self):
- stringValue = pop_key(self.testdict, "string")
- assert_equal( "42", stringValue )
- assert_equal( False, "string" in self.testdict )
-
- def test_pop_key_int(self):
- intValue = pop_key(self.testdict, "int")
- assert_equal( 42, intValue )
- assert_equal( False, "int" in self.testdict )