Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_should_raise_an_exception(self):
keys = ["key1"]
available_keys = ("key1", "key3")
mandatory_keys = ("key1", "key2")
scope = "endpoint"
with pytest.raises(MissingMandatoryKeyError) as excinfo:
validate_keys(keys, available_keys, mandatory_keys, scope)
assert str(excinfo.value) == "Missing 'key2' key(s) at 'endpoint' scope"
def _validate(self):
validate_keys(
self.spec.keys(), self.ALLOWED_KEYS, self.REQUIRED_KEYS, self.SCOPE
)
def _validate(self):
validate_keys(
self.spec.keys(), self.ALLOWED_KEYS, self.REQUIRED_KEYS, self.SCOPE
)
def _validate(self):
validate_keys(self.spec.keys(), self.ALLOWED_KEYS, self.SCOPE)
def _validate(self):
if self.is_root:
return validate_keys(
self.spec.keys(), self.ALLOWED_KEYS, self.ROOT_REQUIRED_KEYS, ROOT_SCOPE
)
validate_keys(
self.spec.keys(), self.ALLOWED_KEYS, self.REQUIRED_KEYS, self.SCOPE
)
def _validate(self):
if self.is_root:
return validate_keys(
self.spec.keys(), self.ALLOWED_KEYS, self.ROOT_REQUIRED_KEYS, ROOT_SCOPE
)
validate_keys(
self.spec.keys(), self.ALLOWED_KEYS, self.REQUIRED_KEYS, self.SCOPE
)