MCPcopy Create free account
hub / github.com/saltstack/salt / test_clear

Method test_clear

tests/unit/test_loader.py:644–661  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

642
643 @pytest.mark.slow_test
644 def test_clear(self):
645 self.assertTrue(
646 isinstance(self.loader["test.ping"], salt.loader.lazy.LoadedFunc)
647 )
648 self.assertTrue(inspect.isfunction(self.loader["test.ping"].func))
649 self.update_module() # write out out custom module
650 self.loader.clear() # clear the loader dict
651
652 # force a load of our module
653 self.assertTrue(
654 isinstance(self.loader[self.module_key], salt.loader.lazy.LoadedFunc)
655 )
656 self.assertTrue(inspect.isfunction(self.loader[self.module_key].func))
657
658 # make sure we only loaded our custom module
659 # which means that we did correctly refresh the file mapping
660 for k, v in self.loader._dict.items():
661 self.assertTrue(k.startswith(self.module_name))
662
663 @pytest.mark.slow_test
664 def test_load(self):

Callers

nothing calls this directly

Calls 3

update_moduleMethod · 0.95
clearMethod · 0.45
itemsMethod · 0.45

Tested by

no test coverage detected