1
# Copyright (C) 2006 Canonical Ltd
1
# Copyright (C) 2006-2010 Canonical Ltd
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
236
237
% (self.test_dir, self.test_dir),
237
238
self.test_dir, recursive=False)
240
def test_ls_directory(self):
241
"""Test --directory option"""
242
self.wt = self.make_branch_and_tree('dir')
243
self.build_tree(['dir/sub/', 'dir/sub/file'])
244
self.wt.add(['sub', 'sub/file'])
245
self.wt.commit('commit')
246
self.ls_equals('sub/\nsub/file\n', '--directory=dir')
247
self.ls_equals('sub/file\n', '-d dir sub')
250
class TestSmartServerLs(TestCaseWithTransport):
252
def test_simple_ls(self):
253
self.setup_smart_server_with_call_log()
254
t = self.make_branch_and_tree('branch')
255
self.build_tree_contents([('branch/foo', 'thecontents')])
258
self.reset_smart_call_log()
259
out, err = self.run_bzr(['ls', self.get_url('branch')])
260
# This figure represent the amount of work to perform this use case. It
261
# is entirely ok to reduce this number if a test fails due to rpc_count
262
# being too low. If rpc_count increases, more network roundtrips have
263
# become necessary for this use case. Please do not adjust this number
264
# upwards without agreement from bzr's network support maintainers.
265
self.assertLength(15, self.hpss_calls)
266
self.expectFailure("inventories can only be accessed over VFS",
267
self.assertThat, self.hpss_calls, ContainsNoVfsCalls)