~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests.py

  • Committer: mbp at sourcefrog
  • Date: 2005-03-26 13:41:53 UTC
  • Revision ID: mbp@sourcefrog.net-20050326134153-3fd9d2c0ee5a06ce
- add test case for ignore files

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
These are run by ``bzr.doctest``.
29
29
 
30
30
>>> import bzrlib, os
 
31
>>> from bzrlib import ScratchBranch
31
32
>>> bzrlib.commands.cmd_rocks()
32
33
it sure does!
33
34
 
173
174
    >>> list(b.working_tree().unknowns())
174
175
    ['d2/d3', 'd2/f2', 'd2/f3']
175
176
 
 
177
Tests for ignored files and patterns:
 
178
 
 
179
    >>> b = ScratchBranch(dirs=['src', 'doc'],
 
180
    ...                   files=['configure.in', 'configure',
 
181
    ...                          'doc/configure', 'foo.c',
 
182
    ...                          'foo'])
 
183
    >>> list(b.unknowns())
 
184
    ['configure', 'configure.in', 'doc', 'foo', 'foo.c', 'src']
 
185
    >>> b.add(['doc', 'foo.c', 'src', 'configure.in'])
 
186
    >>> list(b.unknowns())
 
187
    ['configure', 'doc/configure', 'foo']
 
188
    >>> f = file(b.abspath('.bzrignore'), 'w')
 
189
    >>> f.write('./configure\n'
 
190
    ...         './foo\n')
 
191
    >>> f.close()
 
192
    >>> b.add('.bzrignore')
 
193
    >>> list(b.unknowns())
 
194
    ['configure', 'doc/configure', 'foo']
176
195
"""