1
0
mirror of https://github.com/httpie/cli.git synced 2024-11-24 08:22:22 +02:00

Need a main()

#531
This commit is contained in:
Jakub Roztocil 2016-10-26 11:21:30 +02:00
parent c6f2b32e36
commit 48a6d234cb
2 changed files with 6 additions and 2 deletions

View File

@ -5,9 +5,13 @@
import sys import sys
if __name__ == '__main__': def main():
try: try:
from .core import main from .core import main
sys.exit(main()) sys.exit(main())
except KeyboardInterrupt: except KeyboardInterrupt:
sys.exit(1) sys.exit(1)
if __name__ == '__main__':
main()

View File

@ -11,7 +11,7 @@ def test_Host_header_overwrite(httpbin):
""" """
host = 'httpbin.org' host = 'httpbin.org'
url = httpbin.url + '/get' url = httpbin.url + '/set?k2=v2&k1=v1'
r = http('--print=hH', url, 'host:{0}'.format(host)) r = http('--print=hH', url, 'host:{0}'.format(host))
assert HTTP_OK in r assert HTTP_OK in r
assert r.lower().count('host:') == 1 assert r.lower().count('host:') == 1