IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an email to s dot adaszewski at gmail dot com. User accounts are meant only to report issues and/or generate pull requests. This is a purpose-specific Git hosting for ADARED projects. Thank you for your understanding!
소스 검색

Add test_gen_env_command().

master
부모
커밋
2ba94a1f41
1개의 변경된 파일8개의 추가작업 그리고 1개의 파일을 삭제
  1. +8
    -1
      tests/test_jail.py

+ 8
- 1
tests/test_jail.py 파일 보기

@@ -1,5 +1,6 @@
from focker.jail import backup_file, \
jail_fs_create
jail_fs_create, \
gen_env_command
import tempfile
import os
import subprocess
@@ -65,3 +66,9 @@ def test_jail_fs_create_02():
subprocess.check_output(['focker', 'jail', 'remove', 'test-jail-fs-create-02'])
assert not zfs_exists(name)
assert not os.path.exists(mountpoint)
def test_gen_env_command():
command = gen_env_command('echo $TEST_VARIABLE_1 && echo $TEST_VARIABLE_2',
{'TEST_VARIABLE_1': 'foo', 'TEST_VARIABLE_2': 'foo bar'})
assert command == 'export TEST_VARIABLE_1=foo && export TEST_VARIABLE_2=\'foo bar\' && echo $TEST_VARIABLE_1 && echo $TEST_VARIABLE_2'

불러오는 중...
취소
저장