Python pyasn1.type.error.ValueConstraintError() Examples
The following are 30
code examples of pyasn1.type.error.ValueConstraintError().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
pyasn1.type.error
, or try the search function
.
Example #1
Source File: constraint.py From teleport with Apache License 2.0 | 6 votes |
def _testValue(self, value, idx): for constraint in self._values: try: constraint(value, idx) except error.ValueConstraintError: pass else: return raise error.ValueConstraintError( 'all of %s failed for "%s"' % (self._values, value) ) # TODO: # refactor InnerTypeConstraint # add tests for type check # implement other constraint types # make constraint validation easy to skip
Example #2
Source File: constraint.py From teleport with Apache License 2.0 | 6 votes |
def _testValue(self, value, idx): for constraint in self._values: try: constraint(value, idx) except error.ValueConstraintError: pass else: return raise error.ValueConstraintError( 'all of %s failed for "%s"' % (self._values, value) ) # TODO: # refactor InnerTypeConstraint # add tests for type check # implement other constraint types # make constraint validation easy to skip
Example #3
Source File: constraint.py From teleport with Apache License 2.0 | 6 votes |
def _testValue(self, value, idx): for constraint in self._values: try: constraint(value, idx) except error.ValueConstraintError: pass else: return raise error.ValueConstraintError( 'all of %s failed for "%s"' % (self._values, value) ) # TODO: # refactor InnerTypeConstraint # add tests for type check # implement other constraint types # make constraint validation easy to skip
Example #4
Source File: constraint.py From aqua-monitor with GNU Lesser General Public License v3.0 | 5 votes |
def _testValue(self, value, idx): # XXX index vals for performance? if value not in self._values: raise error.ValueConstraintError(value)
Example #5
Source File: constraint.py From learn_python3_spider with MIT License | 5 votes |
def _testValue(self, value, idx): raise error.ValueConstraintError(value) # Constraints derivation logic
Example #6
Source File: constraint.py From learn_python3_spider with MIT License | 5 votes |
def _testValue(self, value, idx): try: self._values[0](value, idx) except error.ValueConstraintError: return else: raise error.ValueConstraintError(value)
Example #7
Source File: constraint.py From bash-lambda-layer with MIT License | 5 votes |
def __call__(self, value, idx=None): if not self._values: return try: self._testValue(value, idx) except error.ValueConstraintError: raise error.ValueConstraintError( '%s failed at: %r' % (self, sys.exc_info()[1]) )
Example #8
Source File: constraint.py From learn_python3_spider with MIT License | 5 votes |
def _testValue(self, value, idx): if self.__singleTypeConstraint: self.__singleTypeConstraint(value) elif self.__multipleTypeConstraint: if idx not in self.__multipleTypeConstraint: raise error.ValueConstraintError(value) constraint, status = self.__multipleTypeConstraint[idx] if status == 'ABSENT': # XXX presence is not checked! raise error.ValueConstraintError(value) constraint(value)
Example #9
Source File: constraint.py From learn_python3_spider with MIT License | 5 votes |
def _testValue(self, value, idx): if not self._set.issuperset(value): raise error.ValueConstraintError(value)
Example #10
Source File: constraint.py From learn_python3_spider with MIT License | 5 votes |
def _testValue(self, value, idx): if value < self.start or value > self.stop: raise error.ValueConstraintError(value)
Example #11
Source File: constraint.py From learn_python3_spider with MIT License | 5 votes |
def _testValue(self, value, idx): for constraint in self._values: if isinstance(constraint, AbstractConstraint): constraint(value, idx) elif value not in self._set: raise error.ValueConstraintError(value)
Example #12
Source File: constraint.py From learn_python3_spider with MIT License | 5 votes |
def _testValue(self, value, idx): if value not in self._set: raise error.ValueConstraintError(value)
Example #13
Source File: constraint.py From learn_python3_spider with MIT License | 5 votes |
def _testValue(self, value, idx): if value is None: raise error.ValueConstraintError( 'Component is not present:')
Example #14
Source File: constraint.py From aqua-monitor with GNU Lesser General Public License v3.0 | 5 votes |
def _testValue(self, value, idx): try: self._values[0](value, idx) except error.ValueConstraintError: return else: raise error.ValueConstraintError(value)
Example #15
Source File: constraint.py From aqua-monitor with GNU Lesser General Public License v3.0 | 5 votes |
def _testValue(self, value, idx): if self.__singleTypeConstraint: self.__singleTypeConstraint(value) elif self.__multipleTypeConstraint: if idx not in self.__multipleTypeConstraint: raise error.ValueConstraintError(value) constraint, status = self.__multipleTypeConstraint[idx] if status == 'ABSENT': # XXX presense is not checked! raise error.ValueConstraintError(value) constraint(value)
Example #16
Source File: constraint.py From aqua-monitor with GNU Lesser General Public License v3.0 | 5 votes |
def _testValue(self, value, idx): l = len(value) if l < self.start or l > self.stop: raise error.ValueConstraintError(value)
Example #17
Source File: constraint.py From aqua-monitor with GNU Lesser General Public License v3.0 | 5 votes |
def _testValue(self, value, idx): if value < self.start or value > self.stop: raise error.ValueConstraintError(value)
Example #18
Source File: constraint.py From aqua-monitor with GNU Lesser General Public License v3.0 | 5 votes |
def _testValue(self, value, idx): for v in self._values: try: v(value, idx) except error.ValueConstraintError: pass else: return raise error.ValueConstraintError( 'all of %s failed for \"%s\"' % (self._values, value) ) # XXX # add tests for type check
Example #19
Source File: constraint.py From aqua-monitor with GNU Lesser General Public License v3.0 | 5 votes |
def _testValue(self, value, idx): raise error.ValueConstraintError(value) # Constraints derivation logic
Example #20
Source File: constraint.py From aqua-monitor with GNU Lesser General Public License v3.0 | 5 votes |
def __call__(self, value, idx=None): try: self._testValue(value, idx) except error.ValueConstraintError: raise error.ValueConstraintError( '%s failed at: \"%s\"' % (self, sys.exc_info()[1]) )
Example #21
Source File: constraint.py From nzb-subliminal with GNU General Public License v3.0 | 5 votes |
def _testValue(self, value, idx): for v in self._values: try: v(value, idx) except error.ValueConstraintError: pass else: return raise error.ValueConstraintError( 'all of %s failed for \"%s\"' % (self._values, value) ) # XXX # add tests for type check
Example #22
Source File: constraint.py From nzb-subliminal with GNU General Public License v3.0 | 5 votes |
def _testValue(self, value, idx): try: self._values[0](value, idx) except error.ValueConstraintError: return else: raise error.ValueConstraintError(value)
Example #23
Source File: constraint.py From nzb-subliminal with GNU General Public License v3.0 | 5 votes |
def _testValue(self, value, idx): if self.__singleTypeConstraint: self.__singleTypeConstraint(value) elif self.__multipleTypeConstraint: if idx not in self.__multipleTypeConstraint: raise error.ValueConstraintError(value) constraint, status = self.__multipleTypeConstraint[idx] if status == 'ABSENT': # XXX presense is not checked! raise error.ValueConstraintError(value) constraint(value)
Example #24
Source File: constraint.py From nzb-subliminal with GNU General Public License v3.0 | 5 votes |
def _testValue(self, value, idx): l = len(value) if l < self.start or l > self.stop: raise error.ValueConstraintError(value)
Example #25
Source File: constraint.py From nzb-subliminal with GNU General Public License v3.0 | 5 votes |
def _testValue(self, value, idx): if value < self.start or value > self.stop: raise error.ValueConstraintError(value)
Example #26
Source File: constraint.py From nzb-subliminal with GNU General Public License v3.0 | 5 votes |
def _testValue(self, value, idx): # XXX index vals for performance? if value not in self._values: raise error.ValueConstraintError(value)
Example #27
Source File: constraint.py From nzb-subliminal with GNU General Public License v3.0 | 5 votes |
def _testValue(self, value, idx): raise error.ValueConstraintError(value) # Constraints derivation logic
Example #28
Source File: constraint.py From nzb-subliminal with GNU General Public License v3.0 | 5 votes |
def __call__(self, value, idx=None): try: self._testValue(value, idx) except error.ValueConstraintError: raise error.ValueConstraintError( '%s failed at: \"%s\"' % (self, sys.exc_info()[1]) )
Example #29
Source File: constraint.py From teleport with Apache License 2.0 | 5 votes |
def _testValue(self, value, idx): for constraint in self._values: try: constraint(value, idx) except error.ValueConstraintError: continue raise error.ValueConstraintError(value)
Example #30
Source File: constraint.py From teleport with Apache License 2.0 | 5 votes |
def _testValue(self, value, idx): if self.__singleTypeConstraint: self.__singleTypeConstraint(value) elif self.__multipleTypeConstraint: if idx not in self.__multipleTypeConstraint: raise error.ValueConstraintError(value) constraint, status = self.__multipleTypeConstraint[idx] if status == 'ABSENT': # XXX presence is not checked! raise error.ValueConstraintError(value) constraint(value)