How to use the scanapi.utils.validate_keys function in scanapi

To help you get started, we’ve selected a few scanapi examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github camilamaia / scanapi / tests / unit / test_utils.py View on Github external
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"
github camilamaia / scanapi / scanapi / tree / testing_node.py View on Github external
def _validate(self):
        validate_keys(
            self.spec.keys(), self.ALLOWED_KEYS, self.REQUIRED_KEYS, self.SCOPE
        )
github camilamaia / scanapi / scanapi / tree / request_node.py View on Github external
def _validate(self):
        validate_keys(
            self.spec.keys(), self.ALLOWED_KEYS, self.REQUIRED_KEYS, self.SCOPE
        )
github camilamaia / scanapi / scanapi / tree / request_node.py View on Github external
def _validate(self):
        validate_keys(self.spec.keys(), self.ALLOWED_KEYS, self.SCOPE)
github camilamaia / scanapi / scanapi / tree / endpoint_node.py View on Github external
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
        )
github camilamaia / scanapi / scanapi / tree / endpoint_node.py View on Github external
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
        )