# HG changeset patch # User Jeff Hammel # Date 1359351821 28800 # Node ID b4fb27d126aa3cc05d5ffa2b3718a28b3b744bda # Parent 0f62570e80f3ac8737a5b458383cbfb9c31e82f2 tests work again \O/ diff -r 0f62570e80f3 -r b4fb27d126aa tests/sanity.txt --- 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