parent
bdf3e919c9
commit
99661844dd
|
@ -41,7 +41,9 @@ class HostInfo(object):
|
||||||
import os
|
import os
|
||||||
targetdir = %r
|
targetdir = %r
|
||||||
if not os.path.isabs(targetdir):
|
if not os.path.isabs(targetdir):
|
||||||
homedir = os.environ['HOME']
|
homedir = os.environ.get('HOME', '')
|
||||||
|
if not homedir:
|
||||||
|
homedir = os.environ.get('HOMEPATH', '.')
|
||||||
targetdir = os.path.join(homedir, targetdir)
|
targetdir = os.path.join(homedir, targetdir)
|
||||||
if not os.path.exists(targetdir):
|
if not os.path.exists(targetdir):
|
||||||
os.makedirs(targetdir)
|
os.makedirs(targetdir)
|
||||||
|
|
|
@ -43,7 +43,7 @@ class TestHostInfo:
|
||||||
x.initgateway()
|
x.initgateway()
|
||||||
assert x.gw
|
assert x.gw
|
||||||
try:
|
try:
|
||||||
homedir = py.path.local(py.std.os.environ['HOME'])
|
homedir = py.path.local._gethomedir()
|
||||||
expected = homedir.join(name)
|
expected = homedir.join(name)
|
||||||
assert x.gw_remotepath == str(expected)
|
assert x.gw_remotepath == str(expected)
|
||||||
assert x.localdest == expected
|
assert x.localdest == expected
|
||||||
|
|
Loading…
Reference in New Issue