Esempio n. 1
0
    def test_grains(self):
        """ UT: nxos module:grains method - nxapi grains """

        with patch("salt.proxy.nxos.sendline",
                   autospec=True,
                   return_value=n9k_show_ver_list):
            result = nxos_proxy.grains()
            self.assertEqual(result, n9k_grains)
Esempio n. 2
0
    def test_grains_cache_set(self):
        """ UT: nxos module:grains method - nxapi grains cache set """

        with patch("salt.proxy.nxos.DEVICE_DETAILS",
                   {"grains_cache": n9k_grains["nxos"]}):
            with patch(
                    "salt.proxy.nxos.sendline",
                    autospec=True,
                    return_value=n9k_show_ver_list,
            ):
                result = nxos_proxy.grains()
                self.assertEqual(result, n9k_grains)