/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 tests/test_mapping.py

  • Committer: Jelmer Vernooij
  • Date: 2010-05-04 19:39:04 UTC
  • mto: (0.200.912 trunk)
  • mto: This revision was merged to the branch mainline in revision 6960.
  • Revision ID: jelmer@samba.org-20100504193904-m2wac46pz3xcyr10
Support creating dummy files for empty directories.

Show diffs side-by-side

added added

removed removed

Lines of Context:
276
276
 
277
277
    def test_empty(self):
278
278
        ie = InventoryDirectory('foo', 'foo', 'foo')
279
 
        t = directory_to_tree(ie, None, {})
 
279
        t = directory_to_tree(ie, None, {}, None)
280
280
        self.assertEquals(None, t)
281
281
 
282
282
    def test_empty_dir(self):
283
283
        ie = InventoryDirectory('foo', 'foo', 'foo')
284
284
        child_ie = InventoryDirectory('bar', 'bar', 'bar')
285
285
        ie.children['bar'] = child_ie
286
 
        t = directory_to_tree(ie, lambda x: None, {})
 
286
        t = directory_to_tree(ie, lambda x: None, {}, None)
287
287
        self.assertEquals(None, t)
288
288
 
 
289
    def test_empty_dir_dummy_files(self):
 
290
        ie = InventoryDirectory('foo', 'foo', 'foo')
 
291
        child_ie = InventoryDirectory('bar', 'bar', 'bar')
 
292
        ie.children['bar'] = child_ie
 
293
        t = directory_to_tree(ie, lambda x: None, {}, ".mydummy")
 
294
        self.assertTrue(".mydummy" in t)
 
295
 
289
296
    def test_empty_root(self):
290
297
        ie = InventoryDirectory('foo', 'foo', None)
291
298
        child_ie = InventoryDirectory('bar', 'bar', 'bar')
292
299
        ie.children['bar'] = child_ie
293
 
        t = directory_to_tree(ie, lambda x: None, {})
 
300
        t = directory_to_tree(ie, lambda x: None, {}, None)
294
301
        self.assertEquals(Tree(), t)
295
302
 
296
303
    def test_with_file(self):
298
305
        child_ie = InventoryFile('bar', 'bar', 'bar')
299
306
        ie.children['bar'] = child_ie
300
307
        b = Blob.from_string("bla")
301
 
        t1 = directory_to_tree(ie, lambda x: b.id, {})
 
308
        t1 = directory_to_tree(ie, lambda x: b.id, {}, None)
302
309
        t2 = Tree()
303
310
        t2.add(0100644, "bar", b.id)
304
311
        self.assertEquals(t1, t2)