test_bgp.py 884 B

12345678910111213141516171819202122232425262728293031323334
  1. # -*- coding: utf-8 -*-
  2. # Import Python Libs
  3. from __future__ import absolute_import, print_function, unicode_literals
  4. # Import salt libs
  5. import salt.runners.bgp as bgp
  6. # Import Salt Testing Libs
  7. from tests.support.mixins import LoaderModuleMockMixin
  8. from tests.support.unit import TestCase, skipIf
  9. @skipIf(not bgp.HAS_NAPALM, "napalm module required for this test")
  10. class BGPTest(TestCase, LoaderModuleMockMixin):
  11. """
  12. Test the bgp runner
  13. """
  14. def setup_loader_modules(self):
  15. return {
  16. bgp: {
  17. "__opts__": {
  18. "optimization_order": [0, 1, 2],
  19. "renderer": "yaml",
  20. "renderer_blacklist": [],
  21. "renderer_whitelist": [],
  22. }
  23. }
  24. }
  25. def test_neighbors(self):
  26. ret = bgp.neighbors()
  27. self.assertEqual(ret, [])