~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transform.py

  • Committer: Aaron Bentley
  • Date: 2006-06-05 17:52:45 UTC
  • mto: This revision was merged to the branch mainline in revision 1745.
  • Revision ID: aaron.bentley@utoronto.ca-20060605175245-4e3dd578bd49687d
Update transform tests and docs

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
                              find_interesting, build_tree, get_backup_name)
31
31
 
32
32
class TestTreeTransform(TestCaseInTempDir):
 
33
 
33
34
    def setUp(self):
34
35
        super(TestTreeTransform, self).setUp()
35
36
        self.wt = BzrDir.create_standalone_workingtree('.')
492
493
        self.assertRaises(NotVersionedError, find_interesting, wt, wt,
493
494
                          ['uvfile'])
494
495
 
 
496
    def test_set_executability_order(self):
 
497
        """Ensure that executability behaves the same, no matter what order.
 
498
        
 
499
        - create file and set executability simultaneously
 
500
        - create file and set executability afterward
 
501
        - unsetting the executability of a file whose executability has not been
 
502
        declared should throw an exception (this may happen when a
 
503
        merge attempts to create a file with a duplicate ID)
 
504
        """
 
505
        transform, root = self.get_transform()
 
506
        wt = transform._tree
 
507
        transform.new_file('set_on_creation', root, 'Set on creation', 'soc',
 
508
                           True)
 
509
        sac = transform.new_file('set_after_creation', root, 'Set after creation', 'sac')
 
510
        transform.set_executability(True, sac)
 
511
        uws = transform.new_file('unset_without_set', root, 'Unset badly', 'uws')
 
512
        self.assertRaises(KeyError, transform.set_executability, None, uws)
 
513
        transform.apply()
 
514
        self.assertTrue(wt.is_executable('soc'))
 
515
        self.assertTrue(wt.is_executable('sac'))
 
516
 
495
517
 
496
518
class TransformGroup(object):
497
519
    def __init__(self, dirname):