tests/unit/test_junos.py
raw| 1 | # Tests in this file corresponds to /jnpr/junos/__init__.py |
| 2 | |
| 3 | import unittest |
| 4 | import sys |
| 5 | |
| 6 | import nose2 |
| 7 | from unittest.mock import patch |
| 8 | |
| 9 | __author__ = "Nitin Kumar" |
| 10 | __credits__ = "Jeremy Schulman" |
| 11 | |
| 12 | |
| 13 | class TestJunosInit(unittest.TestCase): |
| 14 | def test_warning(self): |
| 15 | print(sys.modules["sys"].version_info) |
| 16 | with patch.object(sys.modules["sys"], "version_info", (3, 8, 0)) as mock_sys: |
| 17 | from jnpr import junos |
| 18 | |
| 19 | self.assertEqual(mock_sys, (3, 8, 0)) |