summaryrefslogtreecommitdiff
path: root/test/git/test_utils.py
diff options
context:
space:
mode:
authorDavid Aguilar <davvid@gmail.com>2008-05-29 17:48:49 -0700
committerDavid Aguilar <davvid@gmail.com>2008-05-29 17:48:49 -0700
commitebee400cfa4a532018ee904c22c7e3e6619ca4de (patch)
treec725ff1212e6c592d06790847eaf7d0a70412c4b /test/git/test_utils.py
parente10706b6c167454a723636e0929061201a2f461b (diff)
downloadgitpython-ebee400cfa4a532018ee904c22c7e3e6619ca4de.tar.gz
tests: add utils.pop_key() testcases
This commit cleans up some unused variables in test_utils.py and adds some testcases for utils.pop_key(). Signed-off-by: David Aguilar <davvid@gmail.com>
Diffstat (limited to 'test/git/test_utils.py')
-rw-r--r--test/git/test_utils.py26
1 files changed, 20 insertions, 6 deletions
diff --git a/test/git/test_utils.py b/test/git/test_utils.py
index b2b42a1c..b6eee00a 100644
--- a/test/git/test_utils.py
+++ b/test/git/test_utils.py
@@ -4,13 +4,27 @@ from git_python import *
class TestUtils(object):
def setup(self):
- base = os.path.join(os.path.dirname(__file__), "../.."),
- self.git = Git(base)
-# self.git_bin_base = "%s --git-dir='%s'" % (Git.git_binary, base)
-
-# def test_it_escapes_single_quotes_with_shell_escape(self):
-# assert_equal("\\\\'foo", shell_escape("'foo"))
+ self.testdict = {
+ "string": "42",
+ "int": 42,
+ "array": [ 42 ],
+ }
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 )