File: test_path_params.py

package info (click to toggle)
python-openapi-core 0.22.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,104 kB
  • sloc: python: 19,979; makefile: 44
file content (23 lines) | stat: -rw-r--r-- 599 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import pytest


class TestMinimal:
    @pytest.mark.parametrize(
        "spec_file",
        [
            "data/v3.0/path_param.yaml",
            "data/v3.1/path_param.yaml",
        ],
    )
    def test_param_present(self, spec_file, schema_path_factory):
        schema_path = schema_path_factory.from_file(spec_file)

        path = schema_path / "paths#/resource/{resId}"

        parameters = path / "parameters"
        assert len(parameters) == 1

        param = parameters[0]
        assert param["name"] == "resId"
        assert param["required"]
        assert param["in"] == "path"