Add support for streamed uploads, --chunked, finish --multipart, etc.

Close #201
Close #753
Close #684
Close #903
Related: #452
This commit is contained in:
Jakub Roztocil
2020-09-28 12:16:57 +02:00
parent b7754f92ce
commit 6925d930da
22 changed files with 498 additions and 328 deletions

View File

@@ -15,7 +15,7 @@ from httpie.cli import constants
from httpie.cli.definition import parser
from httpie.cli.argtypes import KeyValueArg, KeyValueArgType
from httpie.cli.requestitems import RequestItems
from utils import HTTP_OK, MockEnvironment, http
from utils import HTTP_OK, MockEnvironment, StdinBytesIO, http
class TestItemParsing:
@@ -312,10 +312,11 @@ class TestNoOptions:
class TestStdin:
def test_ignore_stdin(self, httpbin):
with open(FILE_PATH) as f:
env = MockEnvironment(stdin=f, stdin_isatty=False)
r = http('--ignore-stdin', '--verbose', httpbin.url + '/get',
env=env)
env = MockEnvironment(
stdin=StdinBytesIO(FILE_PATH.read_bytes()),
stdin_isatty=False,
)
r = http('--ignore-stdin', '--verbose', httpbin.url + '/get', env=env)
assert HTTP_OK in r
assert 'GET /get HTTP' in r, "Don't default to POST."
assert FILE_CONTENT not in r, "Don't send stdin data."