~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_modified.py

  • Committer: Adrian Wilkins
  • Date: 2008-05-21 11:40:35 UTC
  • mto: This revision was merged to the branch mainline in revision 3476.
  • Revision ID: adrian.wilkins@gmail.com-20080521114035-bkrlr55bo5s3vfog
Simplified and fixed test code
 * non_ascii tests updated for ``added`` and ``modified``
 * Removed all dependence on osutils module by using literals

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
from bzrlib.branch import Branch
24
24
from bzrlib.tests.blackbox import ExternalBase
25
 
from bzrlib import osutils
26
25
 
27
26
class TestModified(ExternalBase):
28
27
 
29
28
    def test_modified(self):
30
29
        """Test that 'modified' command reports modified files"""
31
 
        self._test_modified('a')
 
30
        self._test_modified('a', 'a')
32
31
 
33
32
    def test_modified_with_spaces(self):
34
33
        """Test that 'modified' command reports modified files with spaces in their names quoted"""
35
 
        self._test_modified('a filename with spaces')
 
34
        self._test_modified('a filename with spaces', '"a filename with spaces"')
36
35
 
37
 
    def _test_modified(self, name):
 
36
    def _test_modified(self, name, output):
38
37
 
39
38
        def check_modified(expected, null=False):
40
39
            command = 'modified'
57
56
        check_modified('')
58
57
 
59
58
        # after commit, not modified
60
 
        tree.commit(message='add %s' % (osutils.quotefn(name)))
 
59
        tree.commit(message='add %s' % output)
61
60
        check_modified('')
62
61
 
63
62
        # modify the file
64
63
        self.build_tree_contents([(name, 'changed\n')]) 
65
 
        check_modified(osutils.quotefn(name) + '\n')
 
64
        check_modified(output + '\n')
66
65
        
67
 
        # check null seps
 
66
        # check null seps - use the unquoted raw name here
68
67
        check_modified(name + '\0', null=True)
69
68
 
70
69
        # now commit the file and it's no longer modified