This commit is contained in:
Jakub Roztocil
2024-03-04 18:12:18 +01:00
parent db16bbee96
commit 3de7c82077
19 changed files with 140 additions and 147 deletions

View File

@ -15,18 +15,18 @@ class TestBinaryRequestData:
stdin_isatty=False,
stdout_isatty=False
)
r = http('--print=B', 'POST', httpbin.url + '/post', env=env)
r = http('--print=B', 'POST', httpbin + '/post', env=env)
assert r == BIN_FILE_CONTENT
def test_binary_file_path(self, httpbin):
env = MockEnvironment(stdin_isatty=True, stdout_isatty=False)
r = http('--print=B', 'POST', httpbin.url + '/post',
r = http('--print=B', 'POST', httpbin + '/post',
'@' + BIN_FILE_PATH_ARG, env=env)
assert r == BIN_FILE_CONTENT
def test_binary_file_form(self, httpbin):
env = MockEnvironment(stdin_isatty=True, stdout_isatty=False)
r = http('--print=B', '--form', 'POST', httpbin.url + '/post',
r = http('--print=B', '--form', 'POST', httpbin + '/post',
'test@' + BIN_FILE_PATH_ARG, env=env)
assert bytes(BIN_FILE_CONTENT) in bytes(r)