Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
laszewsk committed Nov 26, 2023
1 parent 155ab26 commit 854fd87
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 22 deletions.
15 changes: 2 additions & 13 deletions tests/test_shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,6 @@ def test_cat(self):
assert '.DS' in r2
assert 'variables' in r1

def test_cms(self):
HEADING()
Benchmark.Start()
r1 = Shell.cms('vpn status')
r2 = Shell.cms('echo -r blue "hello"')
print(r1)
print(r2)
Benchmark.Stop()
assert 'True' or 'False' in r1
assert 'hello' in r2

def test_pwd(self):
HEADING()
Benchmark.Start()
Expand All @@ -115,8 +104,8 @@ def test_pwd(self):
def test_open(self):
HEADING()
Benchmark.Start()
filename = '~/cm/cloudmesh-common/cloudmesh/common/console.py'
Shell.open(filename, program='xcode')
filename = 'cloudmesh/common/console.py'
Shell.open(filename)
Benchmark.Stop()
assert True # has to be a visual test!

Expand Down
3 changes: 2 additions & 1 deletion tests/test_shell_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ def test_map_filename(self):
else:
assert result.path == f'C:\\home\\{user}\\cm'
else:
assert result.path == os.path.join(str(Path.home()), 'cm')
if os_is_windows():
assert result.path == os.path.join(str(Path.home()), 'cm')

result = Shell.map_filename(name='scp:user@host:~/cm')
assert result.user == "user"
Expand Down
10 changes: 2 additions & 8 deletions tests/test_shell_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,22 +146,16 @@ def test_map_filename(self):
def test_open(self):
HEADING()
Benchmark.Start()
r = Shell.open('~/cm/cloudmesh-common/tests/test.svg')
r2 = Shell.open('tests/test.svg')
r = Shell.open('tests/test.svg')
if os_is_windows():
assert 'command not found' and 'cannot find the file' not in r
assert 'command not found' and 'cannot find the file' not in r2
print('a')
if os_is_linux():
assert 'command not found' and 'cannot find the file' not in r
assert 'command not found' and 'cannot find the file' not in r2
print('b')
if os_is_mac():
assert 'command not found' and 'cannot find the file' and 'Unable to find application' not in r
assert 'command not found' and 'cannot find the file' and 'Unable to find application' not in r2
r3 = Shell.open('test.svg', program='Google Chrome')
assert 'command not found' and 'cannot find the file' and 'Unable to find application' not in r2

r3 = Shell.open('tests/test.svg', program='Google Chrome')
print('c')

Benchmark.Stop()
Expand Down

0 comments on commit 854fd87

Please sign in to comment.