1
0
mirror of https://github.com/httpie/cli.git synced 2025-08-10 22:42:05 +02:00

Added --default-scheme <URL_SCHEME>

Closes #289
This commit is contained in:
Jakub Roztocil
2016-07-02 12:47:02 +02:00
parent c3735d0422
commit 1124d68946
5 changed files with 19 additions and 4 deletions

View File

@@ -330,8 +330,18 @@ class TestIgnoreStdin:
class TestSchemes:
def test_custom_scheme(self):
def test_invalid_custom_scheme(self):
# InvalidSchema is expected because HTTPie
# shouldn't touch a formally valid scheme.
with pytest.raises(InvalidSchema):
http('foo+bar-BAZ.123://bah')
def test_invalid_scheme_via_via_default_scheme(self):
# InvalidSchema is expected because HTTPie
# shouldn't touch a formally valid scheme.
with pytest.raises(InvalidSchema):
http('bah', '--default=scheme=foo+bar-BAZ.123')
def test_default_scheme(self, httpbin_secure):
url = '{0}:{1}'.format(httpbin_secure.host, httpbin_secure.port)
assert HTTP_OK in http(url, '--default-scheme=https')