Fix username check
@@ -11,13 +11,13 @@ def test_user():
Validate user id and name setting
"""
ts = str(time.time())
+ username = 'yuvipanda'
with tempfile.TemporaryDirectory() as tmpdir:
- username = os.getlogin()
subprocess.check_call([
'repo2docker',
'-v', '{}:/home/{}'.format(tmpdir, username),
'--user-id', '1000',
- '--user-name', 'yuvipanda',
+ '--user-name', username,
tmpdir,
'--',
'/bin/bash',
@@ -27,8 +27,8 @@ def test_user():
with open(os.path.join(tmpdir, 'id')) as f:
assert f.read().strip() == '1000'
with open(os.path.join(tmpdir, 'pwd')) as f:
- assert f.read().strip() == '/home/yuvipanda'
+ assert f.read().strip() == '/home/{}'.format(username)
with open(os.path.join(tmpdir, 'name')) as f:
- assert f.read().strip() == 'yuvipanda'
- with open(os.path.join(tmpdir, 'env_user')) as f:
- assert f.read().strip() == 'yuvipanda'
+ assert f.read().strip() == username
+ with open(os.path.join(tmpdir, 'name')) as f:
+ assert f.read().strip() == username
