mirror of
https://github.com/httpie/cli.git
synced 2024-11-22 07:43:20 +01:00
use the __main__ submodule convention to make it possible to use python -m httpie
This commit is contained in:
parent
860a851a4b
commit
d670513c9f
2
setup.py
2
setup.py
@ -15,5 +15,5 @@ setup(name='httpie',version=httpie.__version__,
|
|||||||
author=httpie.__author__,
|
author=httpie.__author__,
|
||||||
license=httpie.__licence__,
|
license=httpie.__licence__,
|
||||||
packages=['httpie'],
|
packages=['httpie'],
|
||||||
entry_points={'console_scripts': ['http = httpie.httpie:main']},
|
entry_points={'console_scripts': ['http = httpie.__main__:main']},
|
||||||
install_requires=requirements)
|
install_requires=requirements)
|
||||||
|
5
tests.py
5
tests.py
@ -1,12 +1,11 @@
|
|||||||
import unittest
|
import unittest
|
||||||
from StringIO import StringIO
|
from StringIO import StringIO
|
||||||
from httpie import httpie
|
from httpie import __main__
|
||||||
|
|
||||||
|
|
||||||
def http(*args, **kwargs):
|
def http(*args, **kwargs):
|
||||||
stdout = StringIO()
|
stdout = StringIO()
|
||||||
httpie.main(args=args, stdout=stdout,
|
__main__.main(args=args, stdout=stdout, stdin_isatty=True,
|
||||||
stdin_isatty=True,
|
|
||||||
stdout_isatty=False)
|
stdout_isatty=False)
|
||||||
return stdout.getvalue()
|
return stdout.getvalue()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user