[svn r38390] refining the logic: for inplace-localhosts ("optimized localhost")
we do not add any relative path. --HG-- branch : trunk
This commit is contained in:
parent
fa94900836
commit
d3e2c68e03
|
@ -19,9 +19,7 @@ class HostInfo(object):
|
||||||
self.relpath = parts and parts.pop(0) or ""
|
self.relpath = parts and parts.pop(0) or ""
|
||||||
if self.hostname == "localhost" and not self.relpath:
|
if self.hostname == "localhost" and not self.relpath:
|
||||||
self.inplacelocal = True
|
self.inplacelocal = True
|
||||||
if addrel:
|
addrel = "" # inplace localhosts cannot have additions
|
||||||
raise ValueError("inplace localhosts cannot have "
|
|
||||||
"additional path %r" % addrel)
|
|
||||||
else:
|
else:
|
||||||
self.inplacelocal = False
|
self.inplacelocal = False
|
||||||
if not self.relpath:
|
if not self.relpath:
|
||||||
|
|
|
@ -29,9 +29,9 @@ class TestHostInfo(DirSetup):
|
||||||
assert not x.relpath
|
assert not x.relpath
|
||||||
|
|
||||||
def test_addrel(self):
|
def test_addrel(self):
|
||||||
py.test.raises(ValueError, """
|
host = HostInfo("localhost:", addrel="whatever")
|
||||||
HostInfo("localhost:", addrel="whatever")
|
assert host.inplacelocal
|
||||||
""")
|
assert not host.relpath
|
||||||
host = HostInfo("localhost:/tmp", addrel="base")
|
host = HostInfo("localhost:/tmp", addrel="base")
|
||||||
assert host.relpath == "/tmp/base"
|
assert host.relpath == "/tmp/base"
|
||||||
host = HostInfo("localhost:tmp", addrel="base2")
|
host = HostInfo("localhost:tmp", addrel="base2")
|
||||||
|
|
Loading…
Reference in New Issue