MCPcopy Create free account
hub / github.com/StackStorm/st2 / test_get_config

Method test_get_config

st2common/tests/unit/test_param_utils.py:638–652  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

636 self.assertEqual(action_params.get("config_param"), "So generic")
637
638 def test_get_config(self):
639 with mock.patch(
640 "st2common.util.config_loader.ContentPackConfigLoader"
641 ) as config_loader:
642 mock_config_return = {"generic_config_param": "So generic"}
643
644 config_loader().get_config.return_value = mock_config_return
645
646 self.assertEqual(get_config(None, None), {})
647 self.assertEqual(get_config("pack", None), {})
648 self.assertEqual(get_config(None, "user"), {})
649 self.assertEqual(get_config("pack", "user"), mock_config_return)
650
651 config_loader.assert_called_with(pack_name="pack", user="user")
652 config_loader().get_config.assert_called_once()
653
654 def _get_liveaction_model(self, params, with_config_context=False):
655 status = "initializing"

Callers

nothing calls this directly

Calls 2

get_configFunction · 0.90
patchMethod · 0.80

Tested by

no test coverage detected