~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_store.py

  • Committer: Jelmer Vernooij
  • Date: 2011-05-10 07:46:15 UTC
  • mfrom: (5844 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5845.
  • Revision ID: jelmer@samba.org-20110510074615-eptod049ndjxc4i7
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
116
116
 
117
117
    def test_missing_is_absent(self):
118
118
        store = self.get_store()
119
 
        self.failIf('aa' in store)
 
119
        self.assertFalse('aa' in store)
120
120
 
121
121
    def test_adding_fails_when_present(self):
122
122
        my_store = self.get_store()
165
165
        s = self.get_store(u'.', compressed=False)
166
166
        cs.add(StringIO('hello there'), 'a')
167
167
 
168
 
        self.failUnlessExists('a.gz')
169
 
        self.failIf(os.path.lexists('a'))
 
168
        self.assertPathExists('a.gz')
 
169
        self.assertFalse(os.path.lexists('a'))
170
170
 
171
171
        self.assertEquals(gzip.GzipFile('a.gz').read(), 'hello there')
172
172
 
178
178
        self.assertRaises(BzrError, s.add, StringIO('goodbye'), 'a')
179
179
 
180
180
        s.add(StringIO('goodbye'), 'b')
181
 
        self.failUnlessExists('b')
182
 
        self.failIf(os.path.lexists('b.gz'))
 
181
        self.assertPathExists('b')
 
182
        self.assertFalse(os.path.lexists('b.gz'))
183
183
        self.assertEquals(open('b').read(), 'goodbye')
184
184
 
185
185
        self.assertEquals(cs.has_id('b'), True)
230
230
class TestMockTransport(TestCase):
231
231
 
232
232
    def test_isinstance(self):
233
 
        self.failUnless(isinstance(MockTransport(), transport.Transport))
 
233
        self.assertIsInstance(MockTransport(), transport.Transport)
234
234
 
235
235
    def test_has(self):
236
236
        self.assertEqual(False, MockTransport().has('foo'))