Ejemplo n.º 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
Ejemplo n.º 2
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)
Ejemplo n.º 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)
Ejemplo n.º 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
Ejemplo n.º 5
0
 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)
Ejemplo n.º 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
Ejemplo n.º 7
0
 def test_binary_suppresses_when_terminal(self):
     r = http(
         'GET',
         self.url
     )
     self.assertIn(BINARY_SUPPRESSED_NOTICE.decode(), r)
Ejemplo n.º 8
0
 def test_binary_suppresses_when_terminal(self):
     r = http('GET', self.url)
     self.assertIn(BINARY_SUPPRESSED_NOTICE.decode(), r)