Mickaël Schoentgen
c6cbc7dfa5
Uniformize UTF-8 naming ( #1115 )
...
* Uniformize UTF-8 naming
Replace `utf8` -> `utf-8` everywhere.
It should have no impact, `utf8` is an alias of `utf-8` [1].
[1] ee03bad25e/Lib/encodings/aliases.py (L534)
* Always specify the encoding
Let's be explicit over implicit. And prevent future warnings from PEP-597 [1].
[1] https://www.python.org/dev/peps/pep-0597/#using-the-default-encoding-is-a-common-mistake
* Update `UTF8` constant (`utf-8` -> `utf_8`)
* Remove default argument from `str.encode()` and `bytes.decode()`
* Clean-up
2021-08-05 20:58:43 +02:00
Mickaël Schoentgen
a61f9e1114
Minor clean-up ( #1078 )
...
- Remove default arguments to `open()`.
- Make use of `pytest` mechanisms for temporary folders.
2021-05-29 12:06:06 +02:00
Miro Hrončok
355befcbfc
Skip http://pie.dev tests when offline ( #1072 )
2021-05-27 19:30:36 +02:00
Mickaël Schoentgen
a3a08a9a22
Use relative imports ( #1057 )
...
* Use relative imports in test
* Use relative imports
* Add myself to contributors :)
2021-05-05 14:13:39 +02:00
Jan Verbeek
611bcdaab1
Fail gracefully if multiple request data files are supplied ( #1042 )
2021-04-15 09:35:50 +02:00
Jakub Roztocil
1573058811
v2.3.0
2020-10-25 21:12:38 +01:00
Jakub Roztocil
32d8b481e9
Fix --offline --multipart
, add more tests
2020-09-28 16:22:34 +02:00
Jakub Roztocil
6925d930da
Add support for streamed uploads, --chunked, finish --multipart, etc.
...
Close #201
Close #753
Close #684
Close #903
Related: #452
2020-09-28 12:16:57 +02:00
Jakub Roztocil
e4e40e5b06
Request content type
2020-09-25 14:44:22 +02:00
Jakub Roztocil
1813cf6156
Add --multipart
and --boundary
2020-08-19 10:22:50 +02:00
Jakub Roztocil
6cd934d1b8
Add support for multipart upload streaming
...
Close #684 , #201
2020-08-15 17:50:00 +02:00
Carlo Sciolla
c4627cc882
Custom file upload MIME type ( #927 )
...
* Support curl-like syntax for custom MIME type for files
In order to specify a custom MIME type for file uploads, a syntax
similar to that used by cURL is used so that
http -F test_file@/path/to/file.bin;type=application/zip https://...
forwards the user-provided file type if provided, otherwise falling
back to the usual guesswork out of the file extension.
2020-06-08 17:59:41 +02:00
Jakub Roztocil
e6bad645ed
Fixed --form
file upload mixed with redirected stdin
error handling.
...
Close #840
2020-01-23 15:55:00 +01:00
Jakub Roztocil
bece3c77bb
Add one-by-one processing of each HTTP request or response and --offline
2019-09-03 17:14:39 +02:00
Jakub Roztocil
aba3b1ec01
Refactoring
2019-08-31 15:17:10 +02:00
Jakub Roztocil
11be041e06
Rename TestEnvironment
to MockEnvironment
to avoid pytest warnings
...
Close #621
2017-12-28 18:17:48 +01:00
Jakub Roztocil
56f498c153
Detect Content Type of file uploaded in multipart/form-data request
...
Closes #271 #285 #398
This adds filename-based detection. It's still not possible to specify the
content type manually, though.
2016-02-28 15:49:01 +08:00
Luis San Martin
45df860124
PEP8 errors
2015-10-22 14:32:16 -03:00
Jakub Roztocil
0481957715
Fixed multiple uploads with the same field name
...
Closes #267
2014-10-20 14:41:48 +02:00
Jakub Roztocil
2a72ae23d5
Run tests against local httpbin instance via pytest-httpbin.
2014-06-28 16:38:41 +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
3478cbd9ff
More unicode tests.
2014-04-26 17:53:01 +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
27faf06327
Removed last dependencies on unittest. All tests are pytest-only.
2014-04-25 11:39:59 +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
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