1
0
mirror of https://github.com/httpie/cli.git synced 2025-06-29 00:51:30 +02:00

Allow stdin data with password prompt; added tests

Closes #70
This commit is contained in:
Jakub Roztocil
2012-07-16 23:41:27 +02:00
parent 85b3a016eb
commit 681b652bf9
4 changed files with 82 additions and 25 deletions

View File

@ -286,6 +286,16 @@ class AuthTest(BaseTestCase):
self.assertIn('"authenticated": true', r)
self.assertIn('"user": "user"', r)
def test_password_prompt(self):
cliparse.AuthCredentials._getpass = lambda self, prompt: 'password'
r = http('--auth', 'user',
'GET', 'httpbin.org/basic-auth/user/password')
self.assertIn('HTTP/1.1 200', r)
self.assertIn('"authenticated": true', r)
self.assertIn('"user": "user"', r)
#################################################################
# CLI argument parsing related tests.