summaryrefslogtreecommitdiff
path: root/tests/test_vy_device.py
diff options
context:
space:
mode:
authorRoberto Bertó <141527866+bertogravscale@users.noreply.github.com>2023-11-21 14:18:43 -0300
committerGitHub <noreply@github.com>2023-11-21 14:18:43 -0300
commit606df1053e0e36cb9fa50378c484187715adc3fe (patch)
tree4f47eec5d9c582c12470fbd91d9a4ad2490375b1 /tests/test_vy_device.py
parentc724a620bd5e2b5233b2b3518bc47164a5fd562b (diff)
parentae98f19358bb47285c22b901c8153eeed79210e3 (diff)
downloadpyvyos-606df1053e0e36cb9fa50378c484187715adc3fe.tar.gz
pyvyos-606df1053e0e36cb9fa50378c484187715adc3fe.zip
Merge pull request #1 from gravscale/feature/retrieve_show_config
Feature/retrieve show config
Diffstat (limited to 'tests/test_vy_device.py')
-rw-r--r--tests/test_vy_device.py40
1 files changed, 40 insertions, 0 deletions
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()
+