示例#1
0
 def test_encoded_stream(self):
     """Test that --stream works with non-prettified
     redirected terminal output."""
     with open(BIN_FILE_PATH, 'rb') as f:
         env = TestEnvironment(stdin=f, stdin_isatty=False)
         r = http('--pretty=none', '--stream', '--verbose', 'GET',
                  httpbin('/get'), env=env)
     assert BINARY_SUPPRESSED_NOTICE.decode() in r
示例#2
0
文件: tests.py 项目: Elarnon/httpie
 def test_binary_suppresses_when_not_terminal_but_pretty(self):
     r = http(
         '--pretty=all',
         'GET',
         self.url,
         env=TestEnvironment(stdin_isatty=True,
                         stdout_isatty=False)
     )
     self.assertIn(BINARY_SUPPRESSED_NOTICE.decode(), r)
示例#3
0
 def test_binary_suppresses_when_not_terminal_but_pretty(self):
     r = http(
         '--pretty=all',
         'GET',
         self.url,
         env=TestEnvironment(stdin_isatty=True,
                         stdout_isatty=False)
     )
     self.assertIn(BINARY_SUPPRESSED_NOTICE.decode(), r)
示例#4
0
 def test_pretty_redirected_stream(self):
     """Test that --stream works with prettified redirected output."""
     with open(BIN_FILE_PATH, 'rb') as f:
         env = TestEnvironment(colors=256, stdin=f,
                               stdin_isatty=False,
                               stdout_isatty=False)
         r = http('--verbose', '--pretty=all', '--stream', 'GET',
                  httpbin('/get'), env=env)
     assert BINARY_SUPPRESSED_NOTICE.decode() in r
示例#5
0
文件: tests.py 项目: oh4mm/httpie
 def test_encoded_stream(self):
     """Test that --stream works with non-prettified redirected terminal output."""
     with open(BIN_FILE_PATH, 'rb') as f:
         r = http(
             '--pretty=none',
             '--stream',
             '--verbose',
             'GET',
             httpbin('/get'),
             env=TestEnvironment(stdin=f, stdin_isatty=False),
         )
     self.assertIn(BINARY_SUPPRESSED_NOTICE.decode(), r)
示例#6
0
 def test_pretty_redirected_stream(self):
     """Test that --stream works with prettified redirected output."""
     with open(BIN_FILE_PATH, 'rb') as f:
         env = TestEnvironment(colors=256,
                               stdin=f,
                               stdin_isatty=False,
                               stdout_isatty=False)
         r = http('--verbose',
                  '--pretty=all',
                  '--stream',
                  'GET',
                  httpbin('/get'),
                  env=env)
     assert BINARY_SUPPRESSED_NOTICE.decode() in r
示例#7
0
文件: tests.py 项目: Elarnon/httpie
 def test_binary_suppresses_when_terminal(self):
     r = http(
         'GET',
         self.url
     )
     self.assertIn(BINARY_SUPPRESSED_NOTICE.decode(), r)
示例#8
0
文件: tests.py 项目: oh4mm/httpie
 def test_binary_suppresses_when_terminal(self):
     r = http('GET', self.url)
     self.assertIn(BINARY_SUPPRESSED_NOTICE.decode(), r)