Exemplo n.º 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()
Exemplo n.º 2
0
    def test_test_collection_type_mismatch(self):

        a = Module()
        a.test_collection(1)
Exemplo n.º 3
0
from lmod.module import get_user_collections, Module

collections = get_user_collections()

for i in collections:
    a = Module()
    restore_cmd, ret_code = a.get_collection(i), a.test_collection(i)

    print(f"Collection Command: {restore_cmd}    Return Code: {ret_code}")

# test Python collection with debug enabled
a = Module(debug=True)
a.test_collection("Python")

# test default collection with debug enabled
a = Module(debug=True)
a.test_collection()

# This will raise an exception
a.test_collection(1)