def setUp(self): self._serializer = ProtoMessageSerializer(RwpersonDbYang, RwpersonDbYang.Person) self._sample_person = RwpersonDbYang.Person(name="Fred") self._model = RwYang.model_create_libncx() self._model.load_schema_ypbc(RwpersonDbYang.get_schema())
def setUp(self): self._serializer = ProtoMessageSerializer( RwpersonDbYang, RwpersonDbYang.Person ) self._sample_person = RwpersonDbYang.Person(name="Fred") self._model = RwYang.model_create_libncx() self._model.load_schema_ypbc(RwpersonDbYang.get_schema())
def test_keyspec_xpath(self): xpath = "/ps:person/ps:phone[ps:number=\'1234\']" schema = RwpersonDbYang.get_schema() keyspec = RwKeyspec.path_from_xpath(schema, xpath, RwKeyspec.RwXpathType.KEYSPEC) self.assertTrue(keyspec) xpath_r = keyspec.to_xpath(schema) self.assertTrue(xpath_r) self.assertEqual(xpath_r, xpath) print(xpath_r)
def test_keyspec_xpath(self): xpath = "/ps:person/ps:phone[ps:number=\'1234\']" schema = RwpersonDbYang.get_schema() keyspec = RwKeyspec.path_from_xpath(schema, xpath, RwKeyspec.RwXpathType.KEYSPEC) self.assertTrue(keyspec) xpath_r = keyspec.to_xpath(schema) self.assertTrue(xpath_r) self.assertEqual(xpath_r, xpath) print(xpath_r)
def setUp(self): self._serializer = ProtoMessageSerializer( RwpersonDbYang, RwpersonDbYang.Person, RwProjectPersonDbYang, RwProjectPersonDbYang.YangData_RwProject_Project_Person, ) self._sample_person = RwpersonDbYang.Person(name="Fred") self._project_person = RwProjectPersonDbYang.YangData_RwProject_Project_Person( name="Fred") self._model = RwYang.model_create_libyang() self._model.load_schema_ypbc(RwpersonDbYang.get_schema())