Commit Graph

31 Commits

Author SHA1 Message Date
Batuhan Taskaya
ff6f1887b0
[Major] UI Enhancements (#1321)
* Refactor tests to use a text-based standard output. (#1318)

* Implement new style `--help` (#1316)

* Implement man page generation (#1317)

* Implement rich progress bars. (#1324)

* Man page deployment & isolation. (#1325)

* Remove all unsorted usages in the CLI docs

* Implement isolated mode for man page generation

* Add a CI job for autogenerated files

* Distribute man pages through PyPI

* Pin the date for man pages. (#1326)

* Hide suppressed arguments from --help/man pages (#1329)

* Change download spinner to line (#1328)

* Regenerate autogenerated files when pushed against to master. (#1339)

* Highlight options (#1340)

* Additional man page enhancements (#1341)

* Group options by the parent category & highlight -o/--o

* Display (and underline) the METAVAR on man pages.

* Make help message processing more robust (#1342)

* Inherit `help` from `short_help`

* Don't mirror short_help directly.

* Fixup the serialization

* Use `pager` and `man` on `--manual` when applicable (#1343)

* Run `man $program` on --manual

* Page the output of `--manual` for systems that lack man pages

* Improvements over progress bars (separate bar, status line, etc.) (#1346)

* Redesign the --help layout.

* Make our usage of rich compatible with 9.10.0

* Add `HTTPIE_NO_MAN_PAGES`

* Make tests also patch os.get_terminal_size

* Generate CLI spec from HTTPie & Man Page Hook (#1354)

* Generate CLI spec from HTTPie & add man page hook

* Use the full command space for the option headers
2022-04-14 07:43:10 -07:00
Batuhan Taskaya
f3b500119c
Implement basic metrics layout & total elapsed time (#1250)
* Initial metadata processing

* Dynamic coloring and other stuff

* Use -vv / --meta

* More testing

* Cleanup

* Tweek message

Co-authored-by: Jakub Roztocil <jakub@roztocil.co>
2021-12-23 12:13:25 -08:00
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
2f8d7f77bd
Add more download tests (#1114) 2021-07-26 20:27: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
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
Jan Verbeek
84c7327057
Correctly handle single-byte Content-Range (#1032)
HTTPie previously failed if it continued a download with a single byte left.
2021-02-14 13:30:58 +01:00
Shubhendra Singh Chauhan
9883a46575
Cleanup (#993) 2020-12-21 12:03:25 +01:00
Jakub Roztocil
1aa1366f99 Finish --quiet 2020-08-15 15:26:29 +02:00
Nicolas Beltran
2c7f24e3e5 Added additional tests to verify downloads work properly with quiet flag 2020-08-15 15:26:29 +02:00
Nicolas Beltran
69e1067a2c Aesthetic changes 2020-08-15 15:26:29 +02:00
Nicolas Beltran
7e38f9ccf0 Added additional tests for flag and better documentation 2020-08-15 15:26:29 +02:00
Nicolas Beltran
4bd2e622a5 Added tests for --quiet flag 2020-08-15 15:26:29 +02: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
0f654388fc Python 3 annotations, super(), pathlib, etc. 2019-08-30 15:14:51 +02:00
Jakub Roztocil
b3d2c1876e Python 2.7 support removal WIP 2019-08-29 08:53:56 +02:00
Jakub Roztocil
df36d6255d Changed the way the output filename is generated
When ``--download`` without ``--output`` results in a redirect,
now only the initial URL is considered, not the final one.
2019-06-24 12:20:09 +02:00
Mickaël Schoentgen
3a46149de1 Fix several ResourceWarning: unclosed file (#741)
Signed-off-by: Mickaël Schoentgen <contact@tiger-222.fr>
2019-02-04 10:00:30 +01:00
Jakub Roztocil
11be041e06 Rename TestEnvironment to MockEnvironment to avoid pytest warnings
Close #621
2017-12-28 18:17:48 +01:00
Jakub Roztocil
5300b0b490 Fixed #451 - OSError: [Errno 36] File name too long 2016-03-17 15:58:01 +08:00
Jakub Roztocil
a6ebc44a48 Run tests against both HTTP and HTTPS
Some of the tests now use the `httpbin_both` fixture from pytest-httpbin.
Also, made httpbin's CA trusted by default and added `httpbin_secure_untrusted`
fixture  to allow overriding that for particular tests.
2016-03-06 17:42:35 +08:00
Jakub Roztocil
ed08ab133e Refactoring 2016-02-29 15:00:17 +08: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
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
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
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