~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to bzrtools.py

  • Committer: Aaron Bentley
  • Date: 2006-02-15 20:11:02 UTC
  • Revision ID: abentley@panoramicfeedback.com-20060215201102-da90b229c8300506
Updated rsync test to make no assumptions about cwd

Show diffs side-by-side

added added

removed removed

Lines of Context:
113
113
def rsync(source, target, ssh=False, excludes=(), silent=False, 
114
114
          rsync_name="rsync"):
115
115
    """
 
116
    >>> new_dir = tempfile.mkdtemp()
 
117
    >>> old_dir = os.getcwd()
 
118
    >>> os.chdir(new_dir)
116
119
    >>> rsync("a", "b", silent=True)
117
120
    Traceback (most recent call last):
118
121
    RsyncNoFile: No such file a
122
125
    >>> rsync("a", "b", excludes=("*.py",), silent=True, rsync_name="rsyncc")
123
126
    Traceback (most recent call last):
124
127
    NoRsync: rsyncc not found.
 
128
    >>> os.chdir(old_dir)
 
129
    >>> os.rmdir(new_dir)
125
130
    """
126
131
    cmd = [rsync_name, "-av", "--delete"]
127
132
    if ssh: