def test_search_with_results():
httpretty.register_uri(
httpretty.POST, 'https://pypi.python.org/pypi',
body=RESULTS_RESPONSE,
content_type='text/xml'
)
app = Application()
command = app.find('search')
command_tester = CommandTester(command)
command_tester.execute([
('command', command.get_name()),
('tokens', ['pendulum'])
])
output = command_tester.get_display()
assert '\npendulum (0.6.0)\n Python datetimes made easy.\n' == output
评论列表
文章目录