changeset 76:b4fb27d126aa

tests work again \O/
author Jeff Hammel <jhammel@mozilla.com>
date Sun, 27 Jan 2013 21:43:41 -0800
parents 0f62570e80f3
children 00c0f668f332
files tests/sanity.txt
diffstat 1 files changed, 9 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/tests/sanity.txt	Sun Jan 27 20:42:18 2013 -0800
+++ b/tests/sanity.txt	Sun Jan 27 21:43:41 2013 -0800
@@ -3,7 +3,6 @@
 
 Imports::
 
-    >>> import email
     >>> import pkginfo
     >>> from distutils.dist import Distribution
     >>> from StringIO import StringIO
@@ -25,10 +24,13 @@
     >>> newattrs['home_page'] == 'http://example.org'
     True
 
-Convert to email::
+Convert to headers::
 
-    >>> message = email.message.Message()
-    >>> for key, value in newattrs.items():
-    ...     message[key] = value
-    >>> message.keys()
-    >>> message.items()
+    >>> header_dict = dict((attr_name, header_name) for header_name, attr_name, multiple in pkginfo_dist._getHeaderAttrs())
+    >>> info = dict((header_dict[key], value) for key, value in newattrs.items())
+    >>> sorted(info.keys())
+    ['Author', 'Author-email', 'Description', 'Home-Page', 'Keywords', 'License', 'Metadata-Version', 'Name', 'Platform', 'Summary', 'Supported-Platform', 'Version']
+    >>> info['Name'] == 'name'
+    True
+    >>> info['Home-Page'] == 'http://example.org' # it should actually be Home-page: http://svn.python.org/projects/peps/trunk/pep-0314.txt, bug in pkginfo
+    True