Exemplo n.º 1
0
 def test_get_collection(self):
     a = Module()
     assert "module restore settarg" == a.get_collection("settarg")
     assert "module restore default" == a.get_collection()
Exemplo n.º 2
0
    def test_get_collection_type_mismatch(self):

        a = Module()
        a.get_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)