コード例 #1
0
ファイル: test_get_specs.py プロジェクト: JRubics/scanapi
    def test_when_parent_and_child_have_same_spec(self):
        spec = {
            "headers": {
                "child_foo": "child_bar"
            },
            "name": "node",
            "requests": [],
        }

        parent = EndpointNode({
            "headers": {
                "parent_foo": "parent_bar"
            },
            "name": "node",
            "requests": [],
        })

        node = EndpointNode(
            spec,
            parent,
        )

        specs = node._get_specs("headers")

        assert specs == {"parent_foo": "parent_bar", "child_foo": "child_bar"}
コード例 #2
0
ファイル: test_get_specs.py プロジェクト: JRubics/scanapi
    def test_when_there_is_no_spec(self):
        spec = {"name": "node", "requests": []}

        parent = EndpointNode({"name": "node", "requests": []})

        node = EndpointNode(
            spec,
            parent,
        )

        specs = node._get_specs("headers")

        assert specs == {}