mirror of
https://github.com/httpie/cli.git
synced 2025-08-17 15:21:01 +02:00
Strip leading ://
from URLs to allow quick conversion of a pasted URL to calls (#1197)
* Strip leading `://` from URLs to allow quick conversion of a pasted URL to calls Closes #1195 * Markdown lint * Cleanup * Cleanup * Drop extraneous space * Fix example
This commit is contained in:
@ -169,6 +169,16 @@ class TestQuerystring:
|
||||
assert f'"url": "{url}"' in r
|
||||
|
||||
|
||||
@pytest.mark.parametrize(['program_name', 'url_arg', 'parsed_url'], [
|
||||
('http', '://pie.dev/get', 'http://pie.dev/get'),
|
||||
('https', '://pie.dev/get', 'https://pie.dev/get'),
|
||||
])
|
||||
def test_url_leading_colon_slash_slash(program_name, url_arg, parsed_url):
|
||||
env = MockEnvironment(program_name=program_name)
|
||||
args = parser.parse_args(args=[url_arg], env=env)
|
||||
assert args.url == parsed_url
|
||||
|
||||
|
||||
class TestLocalhostShorthand:
|
||||
def test_expand_localhost_shorthand(self):
|
||||
args = parser.parse_args(args=[':'], env=MockEnvironment())
|
||||
|
Reference in New Issue
Block a user