~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests.py

  • Committer: mbp at sourcefrog
  • Date: 2005-04-01 08:22:11 UTC
  • Revision ID: mbp@sourcefrog.net-20050401082211-da0a0e8911740407
- basic support for moving files to different directories - have not done support for renaming them yet, but should be straightforward - some tests, but many cases are not handled yet i think

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
 
30
30
>>> import bzrlib, os
31
31
>>> from bzrlib import ScratchBranch
 
32
>>> from bzrlib.osutils import isdir, isfile
32
33
>>> bzrlib.commands.cmd_rocks()
33
34
it sure does!
34
35
 
197
198
    ['doc/configure']
198
199
    >>> b.add("doc/configure")
199
200
    >>> b.commit("commit more")
 
201
    >>> del b
 
202
 
 
203
Renames, etc:
 
204
 
 
205
    >>> b = ScratchBranch(files=['foo'], dirs=['subdir'])
 
206
    >>> b.add(['foo', 'subdir'])
 
207
    >>> b.commit('add foo')
 
208
    >>> list(b.unknowns())
 
209
    []
 
210
    >>> b.rename(['foo'], 'subdir')
 
211
    foo => subdir/foo
 
212
    >>> b.show_status()
 
213
    R       foo => subdir/foo
 
214
    >>> b.commit("move foo to subdir")
 
215
    >>> isfile(b.abspath('foo'))
 
216
    False
 
217
    >>> isfile(b.abspath('subdir/foo'))
 
218
    True
200
219
 
201
220
"""