summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRoberto Berto <roberto.berto@gmail.com>2023-11-21 11:31:15 -0300
committerRoberto Berto <roberto.berto@gmail.com>2023-11-21 11:31:15 -0300
commit10949e4fd6360babf61c2ccdf44ab5e24b512226 (patch)
treee9886661280b523df17a0d3ef7f74d767d814f72 /tests
parentc724a620bd5e2b5233b2b3518bc47164a5fd562b (diff)
downloadpyvyos-10949e4fd6360babf61c2ccdf44ab5e24b512226.tar.gz
pyvyos-10949e4fd6360babf61c2ccdf44ab5e24b512226.zip
Initial commit for retrieve_config feature
Diffstat (limited to 'tests')
-rw-r--r--tests/__init__.py0
-rw-r--r--tests/test_vy_device.py40
2 files changed, 40 insertions, 0 deletions
diff --git a/tests/__init__.py b/tests/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/__init__.py
diff --git a/tests/test_vy_device.py b/tests/test_vy_device.py
new file mode 100644
index 0000000..5b7070a
--- /dev/null
+++ b/tests/test_vy_device.py
@@ -0,0 +1,40 @@
+import sys
+import os
+import unittest
+from vyapi.device import VyDevice
+from vyapi.device import ApiResponse
+from dotenv import load_dotenv
+import os
+import pprint
+
+load_dotenv()
+
+hostname = os.getenv('VYDEVICE_HOSTNAME')
+key = os.getenv('VYDEVICE_KEY')
+port = os.getenv('VYDEVICE_PORT')
+protocol = os.getenv('VYDEVICE_PROTOCOL')
+verify = os.getenv('VYDEVICE_VERIFY_SSL')
+if verify == "False":
+ verify = False
+else:
+ verify = True
+
+
+
+class TestVyDevice(unittest.TestCase):
+ def setUp(self):
+ self.device = VyDevice(hostname=hostname, key=key, port=port, protocol=protocol, verify=verify)
+
+ def test_show_configuration_content(self):
+ response = self.device.retrieve_show_config(['system'])
+
+ self.assertEqual(response.status, 200)
+ self.assertIsNotNone(response.result)
+ self.assertFalse(response.error)
+
+ def tearDown(self):
+ pass
+
+if __name__ == '__main__':
+ unittest.main()
+