Commit Graph

151 Commits

Author SHA1 Message Date
Dennis Brakhane
f1cd289d51 Fallback to JSON highlighting if subtype contains json
Some JSON based formats like JSON Home Documents[1] don't
use a '+json' suffix, but simply contain json in their
MIME type. Also, some servers might use (outdated)
types like 'application/x-json'.

The JSON formatter can already handle those cases,
but the highlighter was ignoring them.

This commit will let the highlighter choose the JSON
lexer if no other lexer could be found and the MIME subtype
contains 'json'

[1] http://tools.ietf.org/html/draft-nottingham-json-home-03
2014-09-25 00:10:06 +02:00
Jakub Roztocil
b0effe07d9 Fixed --output=/dev/null on Linux
Closes #252
2014-09-07 10:22:21 +02:00
Jakub Roztocil
5084f18568 '\' only escapes separator characters in req-items
It makes easier to work with Windows paths.

Closes #253, #254
2014-09-05 18:36:23 +02:00
Jakub Roztocil
1035710956 Added RequestItems named tuple for convenience. 2014-09-05 07:51:35 +02:00
Jakub Roztocil
ca36f1de04 Handle empty passwords in URL credentials
Closes #242
2014-07-18 13:39:47 +02:00
Jakub Roztocil
529f3bd9b6 Fixed python setup.py test 2014-06-28 19:52:10 +02:00
Jakub Roztocil
2a72ae23d5 Run tests against local httpbin instance via pytest-httpbin. 2014-06-28 16:38:41 +02:00
Jakub Roztocil
040d981f00 Fixed custom Host
Closes #235
2014-06-28 13:24:14 +02:00
Jakub Roztocil
8e170b059c Fixed tests. 2014-06-03 19:45:57 +02:00
Jakub Roztocil
77955c9837 Fixed --timeout
* Require requests >= 2.3.0
* Updated test_timeout_exit_status

Close #185.
2014-05-17 22:33:16 +02:00
Jakub Roztocil
e4c68063b9 Converted built-in formatters to formatter plugins.
Still work in progress and the API should be considered private for now.
2014-05-12 19:12:39 +02:00
Jakub Roztocil
858555abb5 Make sure session and default headers play nice
Before: headers = default + args + session
Now:    headers = default + session + args

Fixes #180
2014-05-08 12:27:50 +01:00
Jakub Roztocil
d9eca19b8f New URL. 2014-05-05 21:17:23 +02:00
Jakub Roztocil
29a564ef56 Added wheel support
Should make installation via pip work on OSX Mavericks (#148).

Also added a nifty Makefile.
2014-04-28 13:25:47 +02:00
Jakub Roztocil
2aa53e4be3 Avoid “__init__.py” files in test directories.
As recommended here:

	https://pytest.org/latest/goodpractises.html
2014-04-28 11:29:41 +02:00
Jakub Roztocil
faec00fd99 Improve support for 'type/subtype+suffix' mime types in the colors output formatter.
E.g.:
* application/ld+json
* application/hal+json

Closes #189, #206
2014-04-28 10:08:03 +02:00
Jakub Roztocil
76ab8b84be Cleanup 2014-04-28 10:01:56 +02:00
Jakub Roztocil
05db75bdb1 Modularized output, refactoring
Making it ready for output formatting plugin API.
2014-04-27 21:58:00 +02:00
Jakub Roztocil
87806acc56 Cleanup 2014-04-26 23:06:39 +02:00
Jakub Roztocil
1169a3eb23 Fixed tests. 2014-04-26 20:14:46 +02:00
Jakub Roztocil
43bc6d0c98 Fixed and added tests for --verbose with unicode headers. 2014-04-26 20:10:15 +02:00
Jakub Roztocil
eca1ffaedb More unicode. 2014-04-26 19:47:14 +02:00
Jakub Roztocil
0bd218eab0 Cleanup 2014-04-26 19:32:08 +02:00
Jakub Roztocil
bbc820bf2e Fixed fixture loading on Windows. 2014-04-26 18:41:28 +02:00
Jakub Roztocil
84a521a827 Added test_unicode_url_query_arg_item. 2014-04-26 18:23:13 +02:00
Jakub Roztocil
a3352af1d4 Added support and tests for unicode support in sessions. 2014-04-26 18:16:30 +02:00
Jakub Roztocil
3478cbd9ff More unicode tests. 2014-04-26 17:53:01 +02:00
Jakub Roztocil
77dcd6e919 Added unicode characters to json fixture. 2014-04-26 17:37:56 +02:00
Jakub Roztocil
467d126b6c Python 3 unicode fixes. 2014-04-26 17:35:26 +02:00
Jakub Roztocil
15e62ad26d Implemented more robust unicode handling.
* Immediatelly convert all args from `bytes` to `str`.
* Added `Environment.stdin_encoding` and `Environment.stdout_encoding`
* Allow unicode characters in HTTP headers and basic auth credentials
  by encoding them using UTF8 instead of latin1 (#212).
2014-04-26 15:07:31 +02:00
Jakub Roztocil
0c45c7cb39 Disabled test_windows_colorized_output 2014-04-26 11:06:50 +02:00
Jakub Roztocil
631e332dad Cleanup 2014-04-25 13:57:33 +02:00
Jakub Roztocil
33422312c5 Cleanup 2014-04-25 13:52:43 +02:00
Jakub Roztocil
1d987c5b4d Improved session tests. 2014-04-25 13:50:44 +02:00
Jakub Roztocil
3c2de34285 Improved auth tests. 2014-04-25 13:10:01 +02:00
Jakub Roztocil
492ee392bd Cleanup 2014-04-25 12:42:50 +02:00
Jakub Roztocil
af4aa3a761 Test improvements. 2014-04-25 12:18:35 +02:00
Jakub Roztocil
27faf06327 Removed last dependencies on unittest. All tests are pytest-only. 2014-04-25 11:39:59 +02:00
Jakub Roztocil
f658d24c93 Parametrize test_docs.py. 2014-04-25 10:41:04 +02:00
Jakub Roztocil
f02169ea71 Added Python 2.6 compatible OrderedDict
To preserver ordr of headers, parameters, etc.
2014-04-24 19:57:19 +02:00
Jakub Roztocil
e5d758e4ce More tests. 2014-04-24 19:32:55 +02:00
Jakub Roztocil
ce2169f4fe Added docstrings for utilities in tests.__init__. 2014-04-24 19:32:55 +02:00
Jakub Roztocil
bdea7be456 Added tests for --debug and --help. 2014-04-24 19:32:55 +02:00
Jakub Roztocil
887f70f595 Added CONTRIBUTING.rst. 2014-04-24 19:32:55 +02:00
Jakub Roztocil
3d079942f4 Finished pytest migration. 2014-04-24 19:32:55 +02:00
Jakub Roztocil
3cb124bba7 Cleanup
XX
2014-04-24 19:32:50 +02:00
Jakub Roztocil
6f28624134 Switched to @pytest.mark.skipif. 2014-04-24 15:17:23 +02:00
Jakub Roztocil
941c0a8c3c Moved fixture constants to tests.fixtures. 2014-04-24 15:17:04 +02:00
Jakub Roztocil
b880e996d0 Converted all unittest asserts to plain, pytest-powered asserts. 2014-04-24 14:58:15 +02:00
Jakub Roztocil
6071fff4af Refactored tests into smaller modules. 2014-04-24 14:07:31 +02:00