aboutsummaryrefslogtreecommitdiffstats
path: root/test/mocks/netconf-pnp-simulator/engine/tests/test_basic_operations.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/mocks/netconf-pnp-simulator/engine/tests/test_basic_operations.py')
-rw-r--r--test/mocks/netconf-pnp-simulator/engine/tests/test_basic_operations.py37
1 files changed, 17 insertions, 20 deletions
diff --git a/test/mocks/netconf-pnp-simulator/engine/tests/test_basic_operations.py b/test/mocks/netconf-pnp-simulator/engine/tests/test_basic_operations.py
index 62d41c259..06164e6b5 100644
--- a/test/mocks/netconf-pnp-simulator/engine/tests/test_basic_operations.py
+++ b/test/mocks/netconf-pnp-simulator/engine/tests/test_basic_operations.py
@@ -1,52 +1,49 @@
-import unittest
import nctest
+
class TestBasicOperations(nctest.NCTestCase):
""" Tests basic NETCONF operations with no prerequisites on datastore content. """
def test_capabilities(self):
- self.assertTrue(":startup" in self.nc.server_capabilities)
- self.assertTrue(":candidate" in self.nc.server_capabilities)
- self.assertTrue(":validate" in self.nc.server_capabilities)
- self.assertTrue(":xpath" in self.nc.server_capabilities)
+ assert ":startup" in self.nc.server_capabilities
+ assert ":candidate" in self.nc.server_capabilities
+ assert ":validate" in self.nc.server_capabilities
+ assert ":xpath" in self.nc.server_capabilities
def test_get(self):
reply = self.nc.get()
- self.check_reply_data(reply)
+ nctest.check_reply_data(reply)
def test_get_config_startup(self):
reply = self.nc.get_config(source='startup')
- self.check_reply_data(reply)
+ nctest.check_reply_data(reply)
def test_get_config_running(self):
reply = self.nc.get_config(source='running')
- self.check_reply_data(reply)
+ nctest.check_reply_data(reply)
def test_copy_config(self):
reply = self.nc.copy_config(source='startup', target='candidate')
- self.check_reply_ok(reply)
+ nctest.check_reply_ok(reply)
def test_neg_filter(self):
reply = self.nc.get(filter=("xpath", "/non-existing-module:non-existing-data"))
- self.check_reply_err(reply)
+ nctest.check_reply_err(reply)
def test_lock(self):
reply = self.nc.lock("startup")
- self.check_reply_ok(reply)
+ nctest.check_reply_ok(reply)
reply = self.nc.lock("running")
- self.check_reply_ok(reply)
+ nctest.check_reply_ok(reply)
reply = self.nc.lock("candidate")
- self.check_reply_ok(reply)
+ nctest.check_reply_ok(reply)
reply = self.nc.lock("startup")
- self.check_reply_err(reply)
+ nctest.check_reply_err(reply)
reply = self.nc.unlock("startup")
- self.check_reply_ok(reply)
+ nctest.check_reply_ok(reply)
reply = self.nc.unlock("running")
- self.check_reply_ok(reply)
+ nctest.check_reply_ok(reply)
reply = self.nc.unlock("candidate")
- self.check_reply_ok(reply)
-
-if __name__ == '__main__':
- unittest.main()
+ nctest.check_reply_ok(reply)