From d3e2c68e03defc961af0422fc3b87cead81ea886 Mon Sep 17 00:00:00 2001 From: hpk Date: Sat, 10 Feb 2007 15:51:25 +0100 Subject: [PATCH] [svn r38390] refining the logic: for inplace-localhosts ("optimized localhost") we do not add any relative path. --HG-- branch : trunk --- py/test/rsession/hostmanage.py | 4 +--- py/test/rsession/testing/test_hostmanage.py | 6 +++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/py/test/rsession/hostmanage.py b/py/test/rsession/hostmanage.py index 0ff54e27c..db0f5968f 100644 --- a/py/test/rsession/hostmanage.py +++ b/py/test/rsession/hostmanage.py @@ -19,9 +19,7 @@ class HostInfo(object): self.relpath = parts and parts.pop(0) or "" if self.hostname == "localhost" and not self.relpath: self.inplacelocal = True - if addrel: - raise ValueError("inplace localhosts cannot have " - "additional path %r" % addrel) + addrel = "" # inplace localhosts cannot have additions else: self.inplacelocal = False if not self.relpath: diff --git a/py/test/rsession/testing/test_hostmanage.py b/py/test/rsession/testing/test_hostmanage.py index afc09ea54..d0d005e95 100644 --- a/py/test/rsession/testing/test_hostmanage.py +++ b/py/test/rsession/testing/test_hostmanage.py @@ -29,9 +29,9 @@ class TestHostInfo(DirSetup): assert not x.relpath def test_addrel(self): - py.test.raises(ValueError, """ - HostInfo("localhost:", addrel="whatever") - """) + host = HostInfo("localhost:", addrel="whatever") + assert host.inplacelocal + assert not host.relpath host = HostInfo("localhost:/tmp", addrel="base") assert host.relpath == "/tmp/base" host = HostInfo("localhost:tmp", addrel="base2")