32
32
from bzrlib.osutils import getcwd
33
33
from bzrlib.tests import TestCaseInTempDir, TestSkipped
34
from bzrlib.transport import memory, urlescape
34
from bzrlib.transport import memory
35
35
import bzrlib.transport
36
import bzrlib.urlutils as urlutils
38
39
def _append(fn, txt):
114
115
self.build_tree(files, transport=t)
115
116
self.assertEqual(True, t.has('a'))
116
117
self.assertEqual(False, t.has('c'))
117
self.assertEqual(True, t.has(urlescape('%')))
118
self.assertEqual(True, t.has(urlutils.escape('%')))
118
119
self.assertEqual(list(t.has_multi(['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'])),
119
120
[True, True, False, False, True, False, True, False])
120
121
self.assertEqual(True, t.has_any(['a', 'b', 'c']))
121
self.assertEqual(False, t.has_any(['c', 'd', 'f', urlescape('%%')]))
122
self.assertEqual(False, t.has_any(['c', 'd', 'f', urlutils.escape('%%')]))
122
123
self.assertEqual(list(t.has_multi(iter(['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']))),
123
124
[True, True, False, False, True, False, True, False])
124
125
self.assertEqual(False, t.has_any(['c', 'c', 'c']))
927
928
for fname in files:
928
929
fname_utf8 = fname.encode('utf-8')
929
930
contents = 'contents of %s\n' % (fname_utf8,)
930
self.check_transport_contents(contents, t, urlescape(fname))
931
self.check_transport_contents(contents, t, urlutils.escape(fname))
932
933
def test_connect_twice_is_same_content(self):
933
934
# check that our server (whatever it is) is accessable reliably