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

Method isInconsistent

pager_lib/pyasn1/type/univ.py:2059–2091  ·  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

2057
2058 @property
2059 def isInconsistent(self):
2060 """Run necessary checks to ensure |ASN.1| object consistency.
2061
2062 Default action is to verify |ASN.1| object against constraints imposed
2063 by `subtypeSpec`.
2064
2065 Raises
2066 ------
2067 :py:class:`~pyasn1.error.PyAsn1tError` on any inconsistencies found
2068 """
2069 if self.componentType is noValue or not self.subtypeSpec:
2070 return False
2071
2072 if self._componentValues is noValue:
2073 return True
2074
2075 mapping = {}
2076
2077 for idx, value in self._componentValues.items():
2078 # Absent fields are not in the mapping
2079 if value is noValue:
2080 continue
2081
2082 mapping[idx] = value
2083
2084 try:
2085 # Represent SequenceOf/SetOf as a bare dict to constraints chain
2086 self.subtypeSpec(mapping)
2087
2088 except error.PyAsn1Error as exc:
2089 return exc
2090
2091 return False
2092
2093class SequenceOf(SequenceOfAndSetOfBase):
2094 __doc__ = SequenceOfAndSetOfBase.__doc__

Callers

nothing calls this directly

Calls 1

itemsMethod · 0.45

Tested by

no test coverage detected