Example #1
0
    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()
Example #2
0
 def test_type_error_describe_collection(self):
     cmd = Module()
     cmd.describe(1)
Example #3
0
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"])