Mickaël Schoentgen
8d35a12d27
Fix several issues found with flake8 ( #1081 )
2021-06-01 14:46:58 +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
Mickaël Schoentgen
464b5b4c1d
Polish Python 2 removal ( #1070 )
2021-05-27 13:05:41 +02:00
Mickaël Schoentgen
264d45cdf5
Modernize the code base with f-strings in tests ( #1069 )
...
Simple concatenations were kept for readability purpose.
2021-05-26 14:09:38 +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
Mickaël Schoentgen
1274d869f6
Replace usage of mock with unittest.mock ( #1054 )
...
Since Python 3, the mock dependency is no more required as
it is already part of the unittest module.
2021-04-30 15:08:27 +02:00
Denis Belavin
3c07a25326
Add support for max-age=0 cookie expiry ( #1029 )
...
Close #998
2021-02-06 10:50:34 +01:00
Gian Ortiz
db685d58b5
Decode headers using utf-8 only if they are not str ( #1020 )
2021-01-13 21:45:56 +01:00
Jakub Roztocil
2afdc958c6
Update URLs
2020-12-23 22:07:27 +01:00
Jakub Roztocil
16ef08a159
Gracefully ignore cookie expiry dates in invalid format
...
Close #963
2020-09-20 09:21:10 +02:00
Katherine Bancroft
0541490dda
Add test to test auth plugin reused in session ( #938 )
...
* Add test to test auth plugin reused in session
* Remove unnecessary assertion in auth-plugin test
* Fixed auth test to use same session file
* Add test for password prompt behaviour in session
* Edit auth readme for plugin clarity
2020-07-10 12:48:26 +02:00
Katherine Bancroft
9500ce136a
Combine cookies from original request and session file
...
Close #932
Co-authored-by: kbanc <katherine.bancoft@gmail.com>
Co-authored-by: Gabriel Cruz <gabs.oficial98@gmail.com>
2020-06-18 23:17:33 +02:00
Jakub Roztocil
37200eb055
Cleanup
2020-06-15 23:02:16 +02:00
Eyitayo Ogunbiyi
9c68d7dd87
Remove expired cookies ( #929 )
...
* added a test for expiring cookies
* updated tests
* set up util for extracting expired cookies from response header
* Revert "updated tests"
This reverts commit a4eb5c4498
.
* Revert "Revert "updated tests""
This reverts commit d242e21bce
.
* added more functionality to get-expired-cookies
* add 'clear expired cookies' from session.json files
* refactored get_expired_cookies
* fixed formatting issues
* ensured key exists in cookie_header dict
* fixed linting errors
* removed unused import
* Added tests for get_expired_cookies util
* Added additional test for get_expired_cookies
* added remove_expired_cookies method directly to sessions class
* extracted logic to clear cookies to sessions.py
* refactored utils
* added tests to check expired cookies being removed from session obj
* added type annotations for methods
* Refactored test_sessions
* Seperated out expiry related tests into own class
* Refactored get_expired_cookies in utils
* Refactored remove cookie methods
* fixed linting errors
* fixed indentation and also pluralized test class name
* removed inheritance from SessionTestbase class
* Moved related test to TestExpiredCookies class
Co-authored-by: kbanc <katherine.bancoft@gmail.com>
2020-06-15 22:28:04 +02:00
Semen Zhydenko
dcd6b63e45
withing -> within ( #795 )
2019-12-02 18:12:51 +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
0f654388fc
Python 3 annotations, super(), pathlib, etc.
2019-08-30 15:14:51 +02:00
Jakub Roztocil
7917f1b40c
Build fixes and clean-up
...
* reflect Python 3.7 release
* fix `pycodestyle` errors
* update `pycodestyle` config
* move `pytest` and `pycodestyle` config to `setup.cfg`
* add `make pycodestyle`
* add `make coveralls`
* etc.
2018-07-12 21:16:16 +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
c948f98b05
Update links
2017-03-10 11:27:38 +01:00
Jakub Roztocil
56afd1adb9
Test suite cleanup
2016-03-01 23:22:50 +08:00
Jakub Roztocil
1127557742
Cleanup
2016-02-28 19:15:35 +08:00
Jakub Roztocil
5898879395
Fixed --download with --session
...
Closes #412
2016-02-28 19:14:10 +08:00
Luis San Martin
45df860124
PEP8 errors
2015-10-22 14:32:16 -03:00
Jakub Roztocil
2b51cb6687
Updated links II.
2015-07-03 18:55:45 +02:00
Marc Abramowitz
873102d5eb
Mark test_session_unicode as xfail
...
There are known problems with unicode in headers.
See https://github.com/jakubroztocil/httpie/issues/282
2015-02-10 06:52:51 -08:00
Jakub Roztocil
2a72ae23d5
Run tests against local httpbin instance via pytest-httpbin.
2014-06-28 16:38:41 +02:00
Jakub Roztocil
8e170b059c
Fixed tests.
2014-06-03 19:45:57 +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
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
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
a3352af1d4
Added support and tests for unicode support in sessions.
2014-04-26 18:16:30 +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
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
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