summaryrefslogtreecommitdiff
path: root/tests/test_vy_device.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_vy_device.py')
-rw-r--r--tests/test_vy_device.py54
1 files changed, 50 insertions, 4 deletions
diff --git a/tests/test_vy_device.py b/tests/test_vy_device.py
index 5b7070a..b101c1d 100644
--- a/tests/test_vy_device.py
+++ b/tests/test_vy_device.py
@@ -10,7 +10,7 @@ import pprint
load_dotenv()
hostname = os.getenv('VYDEVICE_HOSTNAME')
-key = os.getenv('VYDEVICE_KEY')
+apikey = os.getenv('VYDEVICE_APIKEY')
port = os.getenv('VYDEVICE_PORT')
protocol = os.getenv('VYDEVICE_PROTOCOL')
verify = os.getenv('VYDEVICE_VERIFY_SSL')
@@ -20,18 +20,64 @@ else:
verify = True
-
class TestVyDevice(unittest.TestCase):
def setUp(self):
- self.device = VyDevice(hostname=hostname, key=key, port=port, protocol=protocol, verify=verify)
+ self.device = VyDevice(hostname=hostname, apikey=apikey, port=port, protocol=protocol, verify=verify)
- def test_show_configuration_content(self):
+ def test_001_retrieve_show_config(self):
response = self.device.retrieve_show_config(['system'])
+ pprint.pprint(response)
+
+ self.assertEqual(response.status, 200)
+ self.assertIsNotNone(response.result)
+ self.assertFalse(response.error)
+
+ def test_010_configure_set_interface(self):
+ response = self.device.configure_set(path=["interfaces", "dummy", "dum1", "address", "192.168.140.1/24"])
+ #pprint.pprint(response)
+
+ self.assertEqual(response.status, 200)
+ self.assertIsNone(response.result)
+ self.assertFalse(response.error)
+
+
+ def test_011_configure_delete_interface(self):
+ response = self.device.configure_delete(path=["interfaces", "dummy", "dum1"])
+ pprint.pprint(response)
+
+ self.assertEqual(response.status, 200)
+ self.assertIsNone(response.result)
+ self.assertFalse(response.error)
+
+
+ def test_300_config_file_save(self):
+ response = self.device.config_file_save(file="/config/test300.config")
+ pprint.pprint(response)
self.assertEqual(response.status, 200)
self.assertIsNotNone(response.result)
self.assertFalse(response.error)
+ def test_301_config_file_save(self):
+ response = self.device.config_file_save()
+ pprint.pprint(response)
+
+ self.assertEqual(response.status, 200)
+ self.assertIsNotNone(response.result)
+ self.assertFalse(response.error)
+
+
+ def test_302_config_file_load(self):
+ response = self.device.config_file_load(file="/config/test300.config")
+ pprint.pprint(response)
+
+ self.assertEqual(response.status, 200)
+ self.assertIsNone(response.result)
+ self.assertFalse(response.error)
+
+
+
+
def tearDown(self):
pass