Beispiel #1
0
 def test_init_bad_connection_type(self):
     """ UT: nxos module:init method - bad CONNECTION type """
     with patch.object(nxos_proxy, "__opts__",
                       {"proxy": {
                           "connection": "unknown"
                       }}):
         self.assertFalse(nxos_proxy.init())
Beispiel #2
0
    def test_init_opts_none(self):
        """ UT: nxos module:init method - __opts__ connection is None """

        with patch("salt.proxy.nxos.__opts__", {"proxy": {
                "connection": None
        }}):
            with patch("salt.proxy.nxos._init_ssh", autospec=True) as init_ssh:
                result = nxos_proxy.init()
                self.assertEqual(result, init_ssh.return_value)
Beispiel #3
0
    def test_init(self):
        """ UT: nxos module:init method - nxapi proxy """

        with patch.object(nxos_proxy, "__opts__",
                          {"proxy": {
                              "connection": "nxapi"
                          }}):
            with patch("salt.proxy.nxos._init_nxapi",
                       autospec=True) as init_nxapi:
                result = nxos_proxy.init()
                self.assertEqual(result, init_nxapi.return_value)
Beispiel #4
0
    def test_init(self):
        """ UT: nxos module:init method - ssh proxy """

        with patch("salt.proxy.nxos._init_ssh", autospec=True) as init_ssh:
            result = nxos_proxy.init()
            self.assertEqual(result, init_ssh.return_value)