Mercurial > hg > PaInt
changeset 75:0f62570e80f3
add some failing tests
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Sun, 27 Jan 2013 20:42:18 -0800 |
parents | 84890934af1f |
children | b4fb27d126aa |
files | tests/sanity.txt |
diffstat | 1 files changed, 16 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/sanity.txt Sun Jan 27 19:03:42 2013 -0800 +++ b/tests/sanity.txt Sun Jan 27 20:42:18 2013 -0800 @@ -3,13 +3,14 @@ Imports:: + >>> import email >>> import pkginfo >>> from distutils.dist import Distribution >>> from StringIO import StringIO Representative metadata:: - >>> attrs = dict(name='name', version='0.0', description='description') + >>> attrs = dict(name='name', version='0.0', description='description', url='http://example.org') Make a distribution:: @@ -17,3 +18,17 @@ >>> buffer = StringIO() >>> distribution.metadata.write_pkg_file(buffer) >>> pkginfo_dist = pkginfo.Distribution() + >>> pkginfo_dist.parse(buffer.getvalue()) + >>> newattrs = dict([(i, getattr(pkginfo_dist, i)) for i in pkginfo_dist]) + >>> newattrs['name'] == 'name' + True + >>> newattrs['home_page'] == 'http://example.org' + True + +Convert to email:: + + >>> message = email.message.Message() + >>> for key, value in newattrs.items(): + ... message[key] = value + >>> message.keys() + >>> message.items()