本文整理匯總了Python中httpie.output.BINARY_SUPPRESSED_NOTICE.decode方法的典型用法代碼示例。如果您正苦於以下問題:Python BINARY_SUPPRESSED_NOTICE.decode方法的具體用法?Python BINARY_SUPPRESSED_NOTICE.decode怎麽用?Python BINARY_SUPPRESSED_NOTICE.decode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類httpie.output.BINARY_SUPPRESSED_NOTICE
的用法示例。
在下文中一共展示了BINARY_SUPPRESSED_NOTICE.decode方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_encoded_stream
# 需要導入模塊: from httpie.output import BINARY_SUPPRESSED_NOTICE [as 別名]
# 或者: from httpie.output.BINARY_SUPPRESSED_NOTICE import decode [as 別名]
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: test_binary_suppresses_when_not_terminal_but_pretty
# 需要導入模塊: from httpie.output import BINARY_SUPPRESSED_NOTICE [as 別名]
# 或者: from httpie.output.BINARY_SUPPRESSED_NOTICE import decode [as 別名]
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: test_pretty_redirected_stream
# 需要導入模塊: from httpie.output import BINARY_SUPPRESSED_NOTICE [as 別名]
# 或者: from httpie.output.BINARY_SUPPRESSED_NOTICE import decode [as 別名]
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
示例4: test_binary_suppresses_when_terminal
# 需要導入模塊: from httpie.output import BINARY_SUPPRESSED_NOTICE [as 別名]
# 或者: from httpie.output.BINARY_SUPPRESSED_NOTICE import decode [as 別名]
def test_binary_suppresses_when_terminal(self):
r = http(
'GET',
self.url
)
self.assertIn(BINARY_SUPPRESSED_NOTICE.decode(), r)