def test_collection(self): cmd = Module(["settarg"]) # save as collection name "settarg" cmd.save("settarg") # save as "default" collection cmd.save() # show "default" collection cmd.describe() # show "settarg" collection cmd.describe("settarg") assert 0 == cmd.test_collection("settarg") assert 0 == cmd.test_collection()
def test_type_error_save_collection(self): cmd = Module() cmd.save(1)
from lmod.module import Module a = Module("zlib", debug=True) # save module collection with name "zlib" a.save("zlib") # show module collection "zlib" a.describe("zlib") # show "default" module collection a.describe() # Passing a list will throw a type error. since collection name must be a string a.describe(["zlib"])