mirror of
https://github.com/httpie/cli.git
synced 2025-08-14 23:12:36 +02:00
use the __main__ submodule convention to make it possible to use python -m httpie
This commit is contained in:
7
tests.py
7
tests.py
@ -1,13 +1,12 @@
|
||||
import unittest
|
||||
from StringIO import StringIO
|
||||
from httpie import httpie
|
||||
from httpie import __main__
|
||||
|
||||
|
||||
def http(*args, **kwargs):
|
||||
stdout = StringIO()
|
||||
httpie.main(args=args, stdout=stdout,
|
||||
stdin_isatty=True,
|
||||
stdout_isatty=False)
|
||||
__main__.main(args=args, stdout=stdout, stdin_isatty=True,
|
||||
stdout_isatty=False)
|
||||
return stdout.getvalue()
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user