-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Show the actual time elapsed; add docs * `requests.Response._headers_parsed_at` → `requests.Response._httpie_headers_parsed_at` * Add `ELAPSED_TIME_LABEL` constant * Tweak docs * Tweak docs * Allow multiple blank lines in Markdown files * Add rudimentary tests for --meta with different --style’s * Cleanup tests * Cleanup tests * Cleanup tests
- Loading branch information
Showing
10 changed files
with
105 additions
and
61 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,17 @@ | ||
from .utils import http | ||
import pytest | ||
|
||
from httpie.models import ELAPSED_TIME_LABEL | ||
from httpie.output.formatters.colors import PIE_STYLE_NAMES | ||
from .utils import http, MockEnvironment, COLOR | ||
|
||
def test_meta_elapsed_time(httpbin, monkeypatch): | ||
r = http('--meta', httpbin + '/get') | ||
for line in r.splitlines(): | ||
assert 'Elapsed time' in r | ||
|
||
def test_meta_elapsed_time(httpbin): | ||
r = http('--meta', httpbin + '/delay/1') | ||
assert f'{ELAPSED_TIME_LABEL}: 1.' in r | ||
|
||
|
||
@pytest.mark.parametrize('style', ['auto', 'fruity', *PIE_STYLE_NAMES]) | ||
def test_meta_elapsed_time_colors(httpbin, style): | ||
r = http('--style', style, '--meta', httpbin + '/get', env=MockEnvironment(colors=256)) | ||
assert COLOR in r | ||
assert ELAPSED_TIME_LABEL in r |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters