Exemple #1
0
 def test_fd_load_order(self):
     # Create a blank function dispatcher
     fd = FunctionDispatcher(set(), self.hallo)
     # Add modules to allowed list
     fd.module_list = {"Euler", "Math"}
     # Load up Euler module, ensure no other modules load.
     assert fd.reload_module("Euler")
     assert len(fd.function_dict) == 1
     # Load second module, ensure all methods are there.
     assert fd.reload_module("Math")
     assert len(fd.function_dict) == 2
Exemple #2
0
 def test_fd_disallowed_module(self):
     # Create a blank function dispatcher
     fd = FunctionDispatcher(set(), self.hallo)
     # Try and load a module
     assert not fd.reload_module("Euler")