summaryrefslogtreecommitdiff
path: root/tests/test_GitModifier.py
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2012-03-15 22:08:50 +0100
committerGuido Günther <agx@sigxcpu.org>2012-03-15 22:38:32 +0100
commita6bca603b9f3852a784afc76ea1d0a24306f3672 (patch)
tree76559a138b2af9ff334a9525cedb9702cd7b6eb3 /tests/test_GitModifier.py
parent797a229ff721d2d831e6c08b06c3eea272c4dc2b (diff)
downloadgit-buildpackage-a6bca603b9f3852a784afc76ea1d0a24306f3672.tar.gz
git-buildpackage-a6bca603b9f3852a784afc76ea1d0a24306f3672.tar.bz2
git-buildpackage-a6bca603b9f3852a784afc76ea1d0a24306f3672.zip
GitModifier: add __getitem__ and keys()
so it can be used as dictonary
Diffstat (limited to 'tests/test_GitModifier.py')
-rw-r--r--tests/test_GitModifier.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/test_GitModifier.py b/tests/test_GitModifier.py
index 1a5b27c4..38944d8c 100644
--- a/tests/test_GitModifier.py
+++ b/tests/test_GitModifier.py
@@ -9,9 +9,10 @@ def test_author():
Methods tested:
- L{gbp.git.GitModifier.get_author_env}
- L{gbp.git.GitModifier.get_committer_env}
+ - L{gbp.git.GitModifier.keys}
>>> import gbp.git
- >>> modifier = gbp.git.GitModifier("foo", "bar")
+ >>> modifier = gbp.git.GitModifier('foo', 'bar')
>>> modifier.name
'foo'
>>> modifier.email
@@ -24,4 +25,11 @@ def test_author():
Traceback (most recent call last):
...
GitModifierError: Neither comitter nor author
+ >>> modifier.keys()
+ ['name', 'email', 'date']
+ >>> modifier['name']
+ 'foo'
+ >>> modifier['email']
+ 'bar'
+ >>> modifier['date']
"""