diff options
author | Roberto Berto <roberto.berto@gmail.com> | 2023-12-13 01:41:24 -0300 |
---|---|---|
committer | Roberto Berto <roberto.berto@gmail.com> | 2023-12-13 01:41:24 -0300 |
commit | 1cd622e219ceed9ba669bb373a4e4407a9542215 (patch) | |
tree | c4cfb941eac177482b21cdce630f984d11958e2c /tests | |
parent | 8c4de65e48817d3b178ac66ebd5ca5016df4c503 (diff) | |
download | pyvyos-1cd622e219ceed9ba669bb373a4e4407a9542215.tar.gz pyvyos-1cd622e219ceed9ba669bb373a4e4407a9542215.zip |
feature:
- configure_set
- configure_delete
- config_file_save
- config_file_load
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_vy_device.py | 54 |
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 |