def test_get_image_policy_evaluation(self, add_alpine_latest_image, query):
        add_resp, api_conf = add_alpine_latest_image
        image_id = get_image_id(add_resp)

        wait_for_image_to_analyze(image_id, api_conf)

        image_tag = get_image_tag(add_resp)

        query['tag'] = image_tag
        if query.get('policyId'):
            query['policyId'] = get_first_policy_id(api_conf)

        resp = http_get(['images', 'by_id', image_id, 'check'], {'tag': image_tag}, config=api_conf)
        assert resp == APIResponse(200)
Exemple #2
0
    def test_get_image_policy_evaluation(self, add_alpine_latest_image, query):
        add_resp, api_conf = add_alpine_latest_image
        image_id = get_image_id(add_resp)

        wait_for_image_to_analyze(image_id, api_conf)

        image_tag = get_image_tag(add_resp)

        query["tag"] = image_tag
        if query.get("policyId"):
            query["policyId"] = get_first_policy_id(api_conf)

        resp = http_get(
            ["images", "by_id", image_id, "check"], {"tag": image_tag}, config=api_conf
        )
        assert resp == APIResponse(200)