1
0
mirror of https://github.com/httpie/cli.git synced 2025-01-05 22:53:32 +02:00
This commit is contained in:
Shubhendra Singh Chauhan 2020-12-21 16:33:25 +05:30 committed by GitHub
parent 2409077a6d
commit 9883a46575
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 3 additions and 13 deletions

View File

@ -5,15 +5,6 @@ import enum
import re import re
# TODO: Use MultiDict for headers once added to `requests`.
# <https://github.com/jakubroztocil/httpie/issues/130>
# ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
# <https://tools.ietf.org/html/rfc3986#section-3.1>
from enum import Enum
URL_SCHEME_RE = re.compile(r'^[a-z][a-z0-9.+-]*://', re.IGNORECASE) URL_SCHEME_RE = re.compile(r'^[a-z][a-z0-9.+-]*://', re.IGNORECASE)
HTTP_POST = 'POST' HTTP_POST = 'POST'

View File

@ -1,5 +1,4 @@
import os import os
from io import BytesIO
from typing import Callable, Dict, IO, List, Optional, Tuple, Union from typing import Callable, Dict, IO, List, Optional, Tuple, Union
from httpie.cli.argtypes import KeyValueArg from httpie.cli.argtypes import KeyValueArg

View File

@ -283,6 +283,6 @@ def decode_raw_args(
""" """
return [ return [
arg.decode(stdin_encoding) arg.decode(stdin_encoding)
if type(arg) == bytes else arg if type(arg) is bytes else arg
for arg in args for arg in args
] ]

View File

@ -15,6 +15,7 @@ class PyTest(TestCommand):
and runs the tests with no fancy stuff like parallel execution. and runs the tests with no fancy stuff like parallel execution.
""" """
def finalize_options(self): def finalize_options(self):
TestCommand.finalize_options(self) TestCommand.finalize_options(self)
self.test_args = [ self.test_args = [

View File

@ -5,7 +5,6 @@ from urllib.request import urlopen
import pytest import pytest
import mock import mock
import requests
from requests.structures import CaseInsensitiveDict from requests.structures import CaseInsensitiveDict
from httpie.downloads import ( from httpie.downloads import (

View File

@ -182,4 +182,4 @@ def test_json_input_preserve_order(httpbin_both):
'order:={"map":{"1":"first","2":"second"}}') 'order:={"map":{"1":"first","2":"second"}}')
assert HTTP_OK in r assert HTTP_OK in r
assert r.json['data'] == \ assert r.json['data'] == \
'{"order": {"map": {"1": "first", "2": "second"}}}' '{"order": {"map": {"1": "first", "2": "second"}}}'