mirror of
https://github.com/httpie/cli.git
synced 2024-11-07 16:34:35 +01:00
c815e21ef9
* 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
18 lines
570 B
Python
18 lines
570 B
Python
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):
|
|
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
|