Skip to content
Snippets Groups Projects
Commit 1ebd0f9f authored by Guillaume Chanel's avatar Guillaume Chanel
Browse files

Update test script

test cd command error
parent 1e163cc8
Branches
No related tags found
No related merge requests found
Pipeline #19651 failed
......@@ -161,7 +161,7 @@ class Test:
_, std_stderr, _ = self._execute_shell_command(cmd)
if not std_stderr:
raise AssertionError('The command {} should return an error but stderr is empty'.format(str_cmd))
raise AssertionError('The command "{}" should return an error but stderr is empty'.format(str_cmd))
def test_foregroundjobs(self):
......@@ -192,11 +192,17 @@ class Test:
@test
def test_builtin_cd(self):
# Test existing directory
dir = tempfile.TemporaryDirectory()
_, _, cwd = self._execute_shell_command(['cd', dir.name], cwd='.', timeout=1)
if dir.name != cwd:
raise AssertionError('Changing directory failed: the directory shouldbe {} but it is {}'.format(dir, cwd))
#TODO: test if the directory does not exist
# Test non-existing directory
cmd = ['cd', 'thisfoldershouldnotexist']
_, stderr, _ = self._execute_shell_command(cmd, timeout=1)
if not stderr:
raise AssertionError('The command "{}" should return an error but stderr is empty'.format(' '.join(cmd)))
def test_builtin(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment