def test_list_bundles(stdout): with HTTMock(service_mock): tool = tool_repo.get_tool('search') server = Server('localhost') tool.execute(server, ['search', '--path=/content', '--limit=3', 'foo=bar']) eq_(EXPECTED_LIST, unordered_list(stdout.getvalue()))
def test_ls_stdin(stderr, stdout): with HTTMock(service_mock): tool = tool_repo.get_tool('ls') server = Server('localhost') status = tool.execute(server, ['ls']) eq_(0, status) eq_({'node', 'directory'}, unordered_list(stdout.getvalue())) eq_('', stderr.getvalue())
def test_list_users(stderr, stdout): tool = tool_repo.get_tool('user') server = Server('localhost') with HTTMock(list_users_mock): status = tool.execute(server, ['user', 'list']) eq_(OK, status) eq_(EXPECTED_RESPONSE, unordered_list(stdout.getvalue())) eq_('', stderr.getvalue())
def test_groups_users_compact(stderr, stdout): tool = tool_repo.get_tool('group') server = Server('localhost') with HTTMock(list_groups_mock): status = tool.execute(server, ['group', 'list', '--compact']) eq_(OK, status) eq_(COMPACT_GROUPS, unordered_list(stdout.getvalue())) eq_('', stderr.getvalue())
def test_find_stdin(stderr, stdout): with HTTMock(service_mock): tool = tool_repo.get_tool('find') server = Server('localhost') status = tool.execute(server, ['find']) eq_(0, status) eq_({'/content', '/content/path', '/content/path/node', '/content/path/directory'}, unordered_list(stdout.getvalue())) eq_('', stderr.getvalue())