/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transport_implementations.py

  • Committer: Robert Collins
  • Date: 2009-05-23 20:57:12 UTC
  • mfrom: (4371 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4441.
  • Revision ID: robertc@robertcollins.net-20090523205712-lcwbfqk6vwavinuv
MergeĀ .dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
"""Tests for Transport implementations.
18
18
 
155
155
        self.assertEqual(True, t.has('a'))
156
156
        self.assertEqual(False, t.has('c'))
157
157
        self.assertEqual(True, t.has(urlutils.escape('%')))
158
 
        self.assertEqual(list(t.has_multi(['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'])),
159
 
                [True, True, False, False, True, False, True, False])
 
158
        self.assertEqual(list(t.has_multi(['a', 'b', 'c', 'd',
 
159
                                           'e', 'f', 'g', 'h'])),
 
160
                         [True, True, False, False,
 
161
                          True, False, True, False])
160
162
        self.assertEqual(True, t.has_any(['a', 'b', 'c']))
161
 
        self.assertEqual(False, t.has_any(['c', 'd', 'f', urlutils.escape('%%')]))
162
 
        self.assertEqual(list(t.has_multi(iter(['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']))),
163
 
                [True, True, False, False, True, False, True, False])
 
163
        self.assertEqual(False, t.has_any(['c', 'd', 'f',
 
164
                                           urlutils.escape('%%')]))
 
165
        self.assertEqual(list(t.has_multi(iter(['a', 'b', 'c', 'd',
 
166
                                                'e', 'f', 'g', 'h']))),
 
167
                         [True, True, False, False,
 
168
                          True, False, True, False])
164
169
        self.assertEqual(False, t.has_any(['c', 'c', 'c']))
165
170
        self.assertEqual(True, t.has_any(['b', 'b', 'b']))
166
171
 
669
674
            for f in files:
670
675
                self.assertTransportMode(temp_transport, f, mode)
671
676
 
 
677
    def test_create_prefix(self):
 
678
        t = self.get_transport()
 
679
        sub = t.clone('foo').clone('bar')
 
680
        try:
 
681
            sub.create_prefix()
 
682
        except TransportNotPossible:
 
683
            self.assertTrue(t.is_readonly())
 
684
        else:
 
685
            self.assertTrue(t.has('foo/bar'))
 
686
 
672
687
    def test_append_file(self):
673
688
        t = self.get_transport()
674
689
 
1495
1510
        transport.put_bytes('foo', 'bar')
1496
1511
        transport3 = self.get_transport()
1497
1512
        self.check_transport_contents('bar', transport3, 'foo')
1498
 
        # its base should be usable. XXX: This is true only if we don't use
1499
 
        # auhentication, otherwise 'base' doesn't mention the password and we
1500
 
        # can't access it anymore since the password is lost (it *could* be
1501
 
        # mentioned in the url given by the test server) --vila 090226
1502
 
        transport4 = get_transport(transport.base)
1503
 
        self.check_transport_contents('bar', transport4, 'foo')
1504
1513
 
1505
1514
        # now opening at a relative url should give use a sane result:
1506
1515
        transport.mkdir('newdir')
1507
 
        transport5 = get_transport(transport.base + "newdir")
 
1516
        transport5 = self.get_transport('newdir')
1508
1517
        transport6 = transport5.clone('..')
1509
1518
        self.check_transport_contents('bar', transport6, 'foo')
1510
1519