Don't rely on dictionary key order
authorGuido Günther <agx@sigxcpu.org>
Thu, 19 Feb 2015 11:57:47 +0000 (12:57 +0100)
committerGuido Günther <agx@sigxcpu.org>
Fri, 20 Feb 2015 11:43:31 +0000 (12:43 +0100)
to work towards Python3 support

Gbp-Dch: Ignore

gbp/git/modifier.py
tests/test_GitModifier.py

index 2452e0b5a950d33a0455034581252c6727b14280..5878681fd933c9c7ae4d1862e9cbaca37a3e3f61 100644 (file)
@@ -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}
index 0a05d4b81b9c314913eba032afd1b933f8232e1b..8e7930e8aedd93f193fb0c828ce5882251b90da2 100644 (file)
@@ -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):
     ...