~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_store.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-06-08 00:21:20 UTC
  • mfrom: (3453.2.11 fast-checkout2)
  • Revision ID: pqm@pqm.ubuntu.com-20080608002120-r3kcq0kxq24lhnak
Improve build_tree performance (igc, abentley)

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
from bzrlib.store.text import TextStore
27
27
from bzrlib.tests import TestCase, TestCaseInTempDir, TestCaseWithTransport
28
28
import bzrlib.store as store
29
 
import bzrlib.store.versioned
30
29
import bzrlib.transactions as transactions
31
30
import bzrlib.transport as transport
32
31
from bzrlib.transport.memory import MemoryTransport
399
398
 
400
399
    def test_escaped_uppercase(self):
401
400
        """Uppercase letters are escaped for safety on Windows"""
402
 
        my_store = store.TransportStore(MemoryTransport(), prefixed=True,
403
 
            escaped=True)
 
401
        my_store = store.TransportStore(MemoryTransport(), escaped=True)
404
402
        # a particularly perverse file-id! :-)
405
 
        self.assertEquals(my_store._relpath('C:<>'), 'be/%2543%253a%253c%253e')
 
403
        self.assertEquals(my_store._escape_file_id('C:<>'), '%43%3a%3c%3e')
406
404
 
407
405
 
408
406
class TestVersionFileStore(TestCaseWithTransport):
435
433
        self._transaction = transactions.ReadOnlyTransaction()
436
434
        vf = self.vfstore.get_weave_or_empty('id', self._transaction)
437
435
        self.assertRaises(errors.ReadOnlyError, vf.add_lines, 'b', [], [])
438
 
 
439
 
    def test___iter__escaped(self):
440
 
        self.vfstore = store.versioned.VersionedFileStore(MemoryTransport(),
441
 
            prefixed=True, escaped=True)
442
 
        self.vfstore.get_scope = self.get_scope
443
 
        self._transaction = transactions.WriteTransaction()
444
 
        vf = self.vfstore.get_weave_or_empty(' ', self._transaction)
445
 
        vf.add_lines('a', [], [])
446
 
        del vf
447
 
        self._transaction.finish()
448
 
        self.assertEqual([' '], list(self.vfstore))