本文整理汇总了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)