Esempio n. 1
0
 def test_logfile(self, tmpdir):
     logfile = StringIO()
     tcsh('echo line1; echo line2', logfile=logfile)
     logfile.seek(0)
     out = logfile.read()
     outlines = out.strip().splitlines()
     assert outlines[0].startswith('Tcsh-')
     assert outlines[1] == ''
     assert outlines[2] == 'line1'
     assert outlines[3] == 'line2'
     assert outlines[4].startswith('Tcsh')
Esempio n. 2
0
 def test_logfile(self, tmpdir):
     logfile = StringIO()
     cmd = 'echo line1; echo line2'
     tcsh(cmd, logfile=logfile)
     out = logfile.getvalue()
     outlines = out.strip().splitlines()
     assert outlines[0].endswith(cmd)
     assert outlines[1] == ''
     assert outlines[2] == 'line1'
     assert outlines[3] == 'line2'
     assert outlines[4].startswith('Tcsh')
Esempio n. 3
0
 def test_logfile(self, tmpdir):
     logfile = StringIO()
     cmd = 'echo line1; echo line2'
     tcsh(cmd, logfile=logfile)
     out = logfile.getvalue()
     outlines = out.strip().splitlines()
     assert outlines[0].endswith(cmd)
     assert outlines[1] == ''
     assert outlines[2] == 'line1'
     assert outlines[3] == 'line2'
     assert outlines[4].startswith('Tcsh')
Esempio n. 4
0
 def test_ciao(self):
     envs = getenv('source /soft/ciao/bin/ciao.csh', shell='tcsh')
     test_script = ['printenv {}'.format(name) for name in sorted(envs)]
     outlines = tcsh('\n'.join(test_script), env=envs)
     assert outlines == [envs[name] for name in sorted(envs)]
Esempio n. 5
0
 def test_ascds(self):
     envs = getenv('source /home/ascds/.ascrc -r release', shell='tcsh')
     test_script = ['printenv {}'.format(name) for name in sorted(envs)]
     outlines = tcsh('\n'.join(test_script), env=envs)
     assert outlines == [envs[name] for name in sorted(envs)]
Esempio n. 6
0
 def test_env(self):
     envs = getenv('setenv TEST_ENV_VAR2 "hello"', shell='tcsh')
     assert envs['TEST_ENV_VAR2'] == 'hello'
     outlines = tcsh('echo $TEST_ENV_VAR2', env=envs)
     assert outlines == ['hello']
Esempio n. 7
0
 def test_tcsh(self):
     outlines = tcsh('echo line1; echo line2')
     assert outlines == ['line1', 'line2']
Esempio n. 8
0
 def test_ciao(self):
     envs = getenv('source /soft/ciao/bin/ciao.csh', shell='tcsh')
     test_script = ['printenv {}'.format(name) for name in sorted(envs)]
     outlines = tcsh('\n'.join(test_script), env=envs)
     assert outlines == [envs[name] for name in sorted(envs)]
Esempio n. 9
0
 def test_ascds(self):
     envs = getenv('source /home/ascds/.ascrc -r release', shell='tcsh')
     test_script = ['printenv {}'.format(name) for name in sorted(envs)]
     outlines = tcsh('\n'.join(test_script), env=envs)
     assert outlines == [envs[name] for name in sorted(envs)]
Esempio n. 10
0
 def test_env(self):
     envs = getenv('setenv TEST_ENV_VAR2 "hello"', shell='tcsh')
     assert envs['TEST_ENV_VAR2'] == 'hello'
     outlines = tcsh('echo $TEST_ENV_VAR2', env=envs)
     assert outlines == ['hello']
Esempio n. 11
0
 def test_tcsh(self):
     outlines = tcsh('echo line1; echo line2')
     assert outlines == ['line1', 'line2']