MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / isInconsistent

Method isInconsistent

pager_lib/pyasn1/type/univ.py:2688–2722  ·  view source on GitHub ↗

Run necessary checks to ensure |ASN.1| object consistency. Default action is to verify |ASN.1| object against constraints imposed by `subtypeSpec`. Raises ------ :py:class:`~pyasn1.error.PyAsn1tError` on any inconsistencies found

(self)

Source from the content-addressed store, hash-verified

2686
2687 @property
2688 def isInconsistent(self):
2689 """Run necessary checks to ensure |ASN.1| object consistency.
2690
2691 Default action is to verify |ASN.1| object against constraints imposed
2692 by `subtypeSpec`.
2693
2694 Raises
2695 ------
2696 :py:class:`~pyasn1.error.PyAsn1tError` on any inconsistencies found
2697 """
2698 if self.componentType is noValue or not self.subtypeSpec:
2699 return False
2700
2701 if self._componentValues is noValue:
2702 return True
2703
2704 mapping = {}
2705
2706 for idx, value in enumerate(self._componentValues):
2707 # Absent fields are not in the mapping
2708 if value is noValue:
2709 continue
2710
2711 name = self.componentType.getNameByPosition(idx)
2712
2713 mapping[name] = value
2714
2715 try:
2716 # Represent Sequence/Set as a bare dict to constraints chain
2717 self.subtypeSpec(mapping)
2718
2719 except error.PyAsn1Error as exc:
2720 return exc
2721
2722 return False
2723
2724 def prettyPrint(self, scope=0):
2725 """Return an object representation string.

Callers

nothing calls this directly

Calls 1

getNameByPositionMethod · 0.45

Tested by

no test coverage detected