diff options
author | Guido Günther <agx@sigxcpu.org> | 2015-02-19 12:57:47 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2015-02-20 12:43:31 +0100 |
commit | 5f08e249fdf8aac7ba717bc997c12507e82b86f0 (patch) | |
tree | 4f29ce7424d645ef678d1a8edf484ddfdaeefd4a | |
parent | 83b0f9a977d179e31ef8854b2d660e35bf501582 (diff) |
Don't rely on dictionary key order
to work towards Python3 support
Gbp-Dch: Ignore
-rw-r--r-- | gbp/git/modifier.py | 16 | ||||
-rw-r--r-- | tests/test_GitModifier.py | 12 |
2 files changed, 18 insertions, 10 deletions
diff --git a/gbp/git/modifier.py b/gbp/git/modifier.py index 2452e0b..5878681 100644 --- a/gbp/git/modifier.py +++ b/gbp/git/modifier.py @@ -119,9 +119,11 @@ class GitModifier(object): """ Get env vars for authorship information - >>> g = GitModifier("foo", "bar") - >>> g.get_author_env() - {'GIT_AUTHOR_EMAIL': 'bar', 'GIT_AUTHOR_NAME': 'foo'} + >>> g = GitModifier("Joey Ramone", "joey@example.com") + >>> g.get_author_env()['GIT_AUTHOR_EMAIL'] + 'joey@example.com' + >>> g.get_author_env()['GIT_AUTHOR_NAME'] + 'Joey Ramone' @return: Author information suitable to use as environment variables @rtype: C{dict} @@ -132,9 +134,11 @@ class GitModifier(object): """ Get env vars for committer information - >>> g = GitModifier("foo", "bar") - >>> g.get_committer_env() - {'GIT_COMMITTER_NAME': 'foo', 'GIT_COMMITTER_EMAIL': 'bar'} + >>> g = GitModifier("Joey Ramone", "joey@example.com") + >>> g.get_committer_env()['GIT_COMMITTER_EMAIL'] + 'joey@example.com' + >>> g.get_committer_env()['GIT_COMMITTER_NAME'] + 'Joey Ramone' @return: Commiter information suitable to use as environment variables @rtype: C{dict} diff --git a/tests/test_GitModifier.py b/tests/test_GitModifier.py index 0a05d4b..8e7930e 100644 --- a/tests/test_GitModifier.py +++ b/tests/test_GitModifier.py @@ -19,10 +19,14 @@ def test_author(): 'foo' >>> modifier.email 'bar' - >>> modifier.get_author_env() - {'GIT_AUTHOR_EMAIL': 'bar', 'GIT_AUTHOR_NAME': 'foo'} - >>> modifier.get_committer_env() - {'GIT_COMMITTER_NAME': 'foo', 'GIT_COMMITTER_EMAIL': 'bar'} + >>> modifier.get_author_env()['GIT_AUTHOR_EMAIL'] + 'bar' + >>> modifier.get_author_env()['GIT_AUTHOR_NAME'] + 'foo' + >>> modifier.get_committer_env()['GIT_COMMITTER_NAME'] + 'foo' + >>> modifier.get_committer_env()['GIT_COMMITTER_EMAIL'] + 'bar' >>> modifier._get_env('foo') Traceback (most recent call last): ... |