def test_rsync(): |
temp = py.test.ensuretemp('update_website_rsync') |
pkgpath = temp.join('pkg') |
apipath = temp.join('apigen') |
pkgpath.ensure('foo/bar.txt', file=True).write('baz') |
pkgpath.ensure('spam/eggs.txt', file=True).write('spam') |
apipath.ensure('api/foo.html', file=True).write('<html />') |
apipath.ensure('source/spam.html', file=True).write('<html />') |
|
rsyncpath = temp.join('rsync') |
assert not rsyncpath.check() |
gateway = py.execnet.PopenGateway() |
-> update_website.rsync(pkgpath, apipath, gateway, rsyncpath.strpath) |
assert rsyncpath.check(dir=True) |
assert rsyncpath.join('pkg').check(dir=True) |
assert rsyncpath.join('pkg/spam/eggs.txt').read() == 'spam' |
assert rsyncpath.join('apigen').check(dir=True) |
assert rsyncpath.join('apigen/api/foo.html').read() == '<html />' |