Esempio n. 1
0
    def test_cmd_function_absent(self):

        """ UT: nxos module:cmd method - non existent function """

        result = nxos_module.cmd(
            "cool_new_function", "salt_test", "network-admin", encrypted=True
        )
        self.assertFalse(result)
Esempio n. 2
0
    def test_cmd_any_function(self):
        """UT: nxos module:cmd method - check_role function"""

        with patch.dict(
                nxos_module.__salt__,
            {
                "nxos.check_role":
                create_autospec(nxos_module.check_role, return_value=True)
            },
        ):
            result = nxos_module.cmd(
                "check_role",
                "salt_test",
                "network-admin",
                encrypted=True,
                __pub_fun="nxos.cmd",
            )
            self.assertTrue(result)