Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
jpfleischer committed Jan 14, 2024
1 parent 36925b0 commit de84af3
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions tests/test_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import os
import pytest
from cloudmesh.common.util import readfile
from cloudmesh.common.Shell import Shell
from cloudmesh.common.util import banner

Expand All @@ -31,7 +30,7 @@ def test_create_dir(self):
def test_version(self):
banner("test_version")

cmd = "cloudmesh-installer version"
cmd = "cmsi version"
result = Shell.run(cmd)
print(result)
print()
Expand All @@ -41,7 +40,7 @@ def test_info(self):
banner("test_info")
print("PWD:", os.getcwd())

cmd = "cloudmesh-installer info"
cmd = "cmsi info"
result = Shell.run(cmd)
print(result)
print()
Expand All @@ -50,7 +49,7 @@ def test_info(self):
def test_list(self):
banner("list")

cmd = "cloudmesh-installer list"
cmd = "cmsi list"
result = Shell.run(cmd)
print(result)
assert "cloudmesh-common" in result
Expand All @@ -59,7 +58,7 @@ def test_non_existing(self):
banner("test_non_existing")
print("PWD:", os.getcwd())

cmd = "cloudmesh-installer git clone WRONG"
cmd = "cmsi git clone WRONG"
try:
result = Shell.run(cmd)
assert False
Expand All @@ -70,7 +69,7 @@ def test_clone_community(self):
banner("test_clone_community")
print("PWD:", os.getcwd())

cmd = "cloudmesh-installer git clone community"
cmd = "cmsi git clone community"
result = Shell.run(cmd)
print(result)
assert os.path.isdir("cloudmesh-community.github.io")
Expand All @@ -79,7 +78,7 @@ def test_clone_cms(self):
banner("test_clone_cms")
print("PWD:", os.getcwd())

cmd = "cloudmesh-installer git clone cms"
cmd = "cmsi git clone cms"
result = Shell.run(cmd)
print("RESULT:", result)

Expand All @@ -99,10 +98,15 @@ def test_install_cms(self):
banner("test_install_cms")
print("PWD:", os.getcwd())

cmd = "cloudmesh-installer install cms"
cmd = "cmsi install cms"
result = Shell.run(cmd)
print("RESULT:", result)
assert os.path.isdir("cloudmesh-cmd5/cloudmesh_cmd5.egg-info")
# Try to import the module and check if it raises an ImportError
try:
import cloudmesh.shell
assert True
except ImportError:
assert False

def test_cms_help(self):
banner("test_cms_help")
Expand Down

1 comment on commit de84af3

@laszewsk
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_________________________ Test_installer.test_cms_info _________________________

self = <test_installer.Test_installer object at 0x7f5e569e8a50>

def test_cms_info(self):
    banner("test_cms_info")
    print("PWD:", os.getcwd())

    cmd = "cms info"
    result = Shell.run(cmd)
    print(result)
  assert "cloudmesh.common" in result

E AssertionError: assert 'cloudmesh.common' in '* cloudmesh.test\n* cloudmesh.test.CloudmeshTest\n* cloudmesh.test.version\n* cloudmesh.test.command\n* cloudmesh.test.command.test\n'

looks like somehow the info command in cmd5 does not return cloudmesh.common
Maybe we need to run make readme in installer and test for something in the manual page.
however info would be good to figure out why its not working.

maybe we just need a new function that lists all packages in a namespace such as cloudmesh

Please sign in to comment.