def test_hostmanage_optimise_localhost(self): hosts = [HostInfo("localhost") for i in range(3)] config = py.test.config._reparse([self.source]) hm = HostManager(config, hosts=hosts) events = [] hm.init_rsync(events.append) for host in hosts: assert host.inplacelocal assert host.gw_remotepath is None assert not host.relpath assert events
def XXXtest_ssh_rsync_samehost_twice(self): #XXX we have no easy way to have a temp directory remotely! option = py.test.config.option if option.sshtarget is None: py.test.skip("no known ssh target, use -S to set one") host1 = HostInfo("%s" % (option.sshtarget, )) host2 = HostInfo("%s" % (option.sshtarget, )) hm = HostManager(config, hosts=[host1, host2]) events = [] hm.init_rsync(events.append) print events assert 0
def test_hostmanager_init_rsync_roots(self): dir2 = self.source.ensure("dir1", "dir2", dir=1) self.source.ensure("dir1", "somefile", dir=1) dir2.ensure("hello") self.source.ensure("bogusdir", "file") self.source.join("conftest.py").write(py.code.Source(""" dist_rsync_roots = ['dir1/dir2'] """)) config = py.test.config._reparse([self.source]) hm = HostManager(config, hosts=[HostInfo("localhost:" + str(self.dest))]) events = [] hm.init_rsync(reporter=events.append) assert self.dest.join("dir2").check() assert not self.dest.join("dir1").check() assert not self.dest.join("bogus").check()