From 48a6d234cb2accf501da109cce7898a1e4cc340c Mon Sep 17 00:00:00 2001 From: Jakub Roztocil Date: Wed, 26 Oct 2016 11:21:30 +0200 Subject: [PATCH] Need a `main()` #531 --- httpie/__main__.py | 6 +++++- tests/test_regressions.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/httpie/__main__.py b/httpie/__main__.py index 83f3c690..41913942 100644 --- a/httpie/__main__.py +++ b/httpie/__main__.py @@ -5,9 +5,13 @@ import sys -if __name__ == '__main__': +def main(): try: from .core import main sys.exit(main()) except KeyboardInterrupt: sys.exit(1) + + +if __name__ == '__main__': + main() diff --git a/tests/test_regressions.py b/tests/test_regressions.py index 3ad44130..c452a7cd 100644 --- a/tests/test_regressions.py +++ b/tests/test_regressions.py @@ -11,7 +11,7 @@ def test_Host_header_overwrite(httpbin): """ host = 'httpbin.org' - url = httpbin.url + '/get' + url = httpbin.url + '/set?k2=v2&k1=v1' r = http('--print=hH', url, 'host:{0}'.format(host)) assert HTTP_OK in r assert r.lower().count('host:') == 1