~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transport.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-04-26 08:34:14 UTC
  • mfrom: (2018.18.25 hpss-faster-copy)
  • Revision ID: pqm@pqm.ubuntu.com-20070426083414-8xgtmyk47txgquaw
Repository.tarball operation to speed initial checkouts

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2004, 2005, 2006 Canonical Ltd
 
1
# Copyright (C) 2004, 2005, 2006, 2007 Canonical Ltd
2
2
#
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
21
21
from cStringIO import StringIO
22
22
 
23
23
import bzrlib
24
 
from bzrlib import urlutils
 
24
from bzrlib import (
 
25
    errors,
 
26
    urlutils,
 
27
    )
25
28
from bzrlib.errors import (ConnectionError,
26
29
                           DependencyNotPresent,
27
30
                           FileExists,
125
128
        self.assertEqual('/etc',
126
129
                         t._combine_paths('/home/sarah', '/etc'))
127
130
 
 
131
    def test_local_abspath_non_local_transport(self):
 
132
        # the base implementation should throw
 
133
        t = MemoryTransport()
 
134
        e = self.assertRaises(errors.NotLocalUrl, t.local_abspath, 't')
 
135
        self.assertEqual('memory:///t is not a local path.', str(e))
 
136
 
128
137
 
129
138
class TestCoalesceOffsets(TestCase):
130
139
    
465
474
        transport = self.get_nfs_transport('.')
466
475
        self.build_tree(['from/', 'from/foo', 'to/', 'to/bar'],
467
476
                        transport=transport)
468
 
        self.assertRaises(bzrlib.errors.ResourceBusy,
 
477
        self.assertRaises(errors.ResourceBusy,
469
478
                          transport.rename, 'from', 'to')
470
479
 
471
480
 
564
573
        self.assertIsInstance(t, LocalTransport)
565
574
        self.assertEquals(t.base, here_url)
566
575
 
 
576
    def test_local_abspath(self):
 
577
        here = os.path.abspath('.')
 
578
        t = get_transport(here)
 
579
        self.assertEquals(t.local_abspath(''), here)
 
580
 
567
581
 
568
582
class TestWin32LocalTransport(TestCase):
569
583