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
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)
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
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)
def test_binary_suppresses_when_terminal(self): r = http( 'GET', self.url ) self.assertIn(BINARY_SUPPRESSED_NOTICE.decode(), r)
def test_binary_suppresses_when_terminal(self): r = http('GET', self.url) self.assertIn(BINARY_SUPPRESSED_NOTICE.decode(), r)