def test_xml_decode_oc_pattern(self): self.provider.encoding = EncodingFormat.XML obj_A = OcA() obj_A.a = 'Hello' entity = self.codec.decode(self.provider, self._xml_oc_pattern_payload) self.assertEqual(obj_A.a, entity.a)
def test_oc_pattern(self): # Create OcA oc = OcA() oc.a = 'xyz' oc.b.b = 'xyz' self.crud.create(self.ncc, oc) # Read into Runner1 oc1 = self.crud.read(self.ncc, OcA()) # Compare runners self.assertEqual(oc, oc1) # Delete oc = OcA() oc.a = 'xyz' self.crud.delete(self.ncc, oc)
def test_read_oc_patttern(self): obj_A = OcA() obj_A.a = 'hello' obj_A.b.b = obj_A.a # 'world' --> YPYServiceProviderError: illegal reference self.crud.create(self.ncc, obj_A) obj_A_read = self.crud.read(self.ncc, OcA(), True) self.assertEqual(is_equal(obj_A, obj_A_read), True)
def test_decode_oc_pattern(self): obj_A = OcA() obj_A.a = 'Hello' entity = self.codec.decode(self.provider, self._oc_pattern_payload) self.assertEqual(is_equal(obj_A, entity), True)