Compare commits

...

7 Commits
0.2.4 ... 0.2.5

Author SHA1 Message Date
1ce02ebbd5 0.2.5 (bugfixes) 2012-07-17 01:39:02 +02:00
8a7f4c0d6e Fixed tests exist status. 2012-07-17 01:33:18 +02:00
f29c458611 Python 3 fixes. 2012-07-17 01:26:21 +02:00
2d7df0afb4 Fixed AttributeError in Content-Type vendor removal. 2012-07-17 01:11:43 +02:00
16a7d0a719 Fixed accidentally remove __licence__. 2012-07-17 01:11:01 +02:00
0cffda86f6 0.2.5dev 2012-07-17 00:47:42 +02:00
f42ee6da85 0.2.5dev 2012-07-17 00:45:20 +02:00
5 changed files with 16 additions and 10 deletions

View File

@ -225,7 +225,7 @@ Before a pull requests is submitted, it's a good idea to run the existing suite
Changelog
---------
* `0.2.4 <https://github.com/jkbr/httpie/compare/0.2.2...0.2.4>`_ (2012-06-24)
* `0.2.5 <https://github.com/jkbr/httpie/compare/0.2.2...0.2.5>`_ (2012-07-17)
* Unicode characters in prettified JSON now don't get escaped to improve readability.
* --auth now prompts for a password if only a username provided.
* Added support for request payloads from a file path with automatic ``Content-Type`` (``http URL @/path``).

View File

@ -3,5 +3,5 @@ HTTPie - cURL for humans.
"""
__author__ = 'Jakub Roztocil'
__version__ = '0.2.4'
__version__ = '0.2.5'
__licence__ = 'BSD'

View File

@ -19,7 +19,7 @@ FORMATTER = (Terminal256Formatter
if '256color' in os.environ.get('TERM', '')
else TerminalFormatter)
application_content_type_re = re.compile(r'application/(.+\+)?(json|xml)$')
application_content_type_re = re.compile(r'application/(.+\+)(json|xml)$')
class PrettyHttp(object):
@ -40,7 +40,7 @@ class PrettyHttp(object):
if application_match:
# Strip vendor and extensions from Content-Type
vendor, extension = application_match.groups()
content_type = content_type.replace(vendor, u"")
content_type = content_type.replace(vendor, '')
try:
lexer = get_lexer_for_mimetype(content_type)

View File

@ -5,7 +5,8 @@ import httpie
if sys.argv[-1] == 'test':
sys.exit(os.system('python tests/tests.py'))
status = os.system('python tests/tests.py')
sys.exit(1 if status > 127 else status)
requirements = [

View File

@ -5,7 +5,7 @@ import os
import sys
import tempfile
import json
from requests.compat import is_py26
from requests.compat import is_py26, is_py3
from requests import Response
@ -453,7 +453,7 @@ class FakeResponse(Response):
return self
def __repr__(self):
return u'Mock string'
return 'Mock string'
def __unicode__(self):
return self.__repr__()
@ -470,8 +470,13 @@ class UnicodeOutputTestCase(BaseTestCase):
def test_unicode_output(self):
# some cyrillic and simplified chinese symbols
response_dict = {u'Привет': u'Мир!',
u'Hello': u'世界'}
response_dict = {'Привет': 'Мир!',
'Hello': '世界'}
if not is_py3:
response_dict = dict(
(k.decode('utf8'), v.decode('utf8'))
for k, v in response_dict.items()
)
response_body = json.dumps(response_dict)
# emulate response
response = FakeResponse(response_body)
@ -486,7 +491,7 @@ class UnicodeOutputTestCase(BaseTestCase):
# colorized output contains escape sequences
output = __main__._get_output(args, True, response)
for key, value in response_dict.iteritems():
for key, value in response_dict.items():
self.assertIn(key, output)
self.assertIn(value, output)