~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/teststore.py

  • Committer: John Arbash Meinel
  • Date: 2005-09-29 21:13:03 UTC
  • mto: (1393.1.12)
  • mto: This revision was merged to the branch mainline in revision 1396.
  • Revision ID: john@arbash-meinel.com-20050929211303-7f1f9bf969d65dc3
All tests pass.

Show diffs side-by-side

added added

removed removed

Lines of Context:
92
92
    check_equals(tester, store, ['b', 'd', 'c'], ['other', None, 'something'],
93
93
            permit_failure=True)
94
94
 
95
 
def get_compressed_store():
96
 
    t = LocalTransport('.')
 
95
def get_compressed_store(path='.'):
 
96
    t = LocalTransport(path)
97
97
    return CompressedTextStore(t)
98
98
 
99
 
def get_text_store():
100
 
    t = LocalTransport('.')
 
99
def get_text_store(path='.'):
 
100
    t = LocalTransport(path)
101
101
    return TextStore(t)
102
102
 
103
103
class TestCompressedTextStore(TestCaseInTempDir):
118
118
    def test_copy_all(self):
119
119
        """Test copying"""
120
120
        os.mkdir('a')
121
 
        store_a = CompressedTextStore('a')
 
121
        store_a = get_text_store('a')
122
122
        store_a.add('foo', '1')
123
123
        os.mkdir('b')
124
 
        store_b = CompressedTextStore('b')
 
124
        store_b = get_text_store('b')
125
125
        copy_all(store_a, store_b)
126
126
        self.assertEqual(store_a['1'].read(), 'foo')
127
127
        self.assertEqual(store_b['1'].read(), 'foo')
149
149
    def test_copy_all(self):
150
150
        """Test copying"""
151
151
        os.mkdir('a')
152
 
        store_a = TextStore('a')
 
152
        store_a = get_text_store('a')
153
153
        store_a.add('foo', '1')
154
154
        os.mkdir('b')
155
 
        store_b = TextStore('b')
 
155
        store_b = get_text_store('b')
156
156
        copy_all(store_a, store_b)
157
157
        self.assertEqual(store_a['1'].read(), 'foo')
158
158
        self.assertEqual(store_b['1'].read(), 'foo')