|
10 | 10 | with before.each:
|
11 | 11 | self.client = SdScanningClient(sdc_url=os.getenv("SDC_SECURE_URL", "https://secure.sysdig.com"),
|
12 | 12 | token=os.getenv("SDC_SECURE_TOKEN"))
|
| 13 | + self.image_to_scan = "quay.io/sysdig/agent:latest" |
13 | 14 |
|
14 | 15 | with it("is able to retrieve the OS contents"):
|
15 |
| - ok, res = self.client.query_image_content("alpine:latest", "os") |
| 16 | + ok, res = self.client.query_image_content(self.image_to_scan, "os") |
16 | 17 |
|
17 | 18 | expect((ok, res)).to(be_successful_api_call)
|
18 | 19 | expect(res["content"]).to(contain(have_keys("license", "origin", "package", "size", "type", "version")))
|
19 | 20 | expect(res["content_type"]).to(equal("os"))
|
20 | 21 |
|
21 | 22 | with it("is able to retrieve the npm contents"):
|
22 |
| - ok, res = self.client.query_image_content("alpine:latest", "npm") |
| 23 | + ok, res = self.client.query_image_content(self.image_to_scan, "npm") |
23 | 24 |
|
24 | 25 | expect((ok, res)).to(be_successful_api_call)
|
25 | 26 | expect(res["content_type"]).to(equal("npm"))
|
26 | 27 |
|
27 | 28 | with it("is able to retrieve the gem contents"):
|
28 |
| - ok, res = self.client.query_image_content("alpine:latest", "gem") |
| 29 | + ok, res = self.client.query_image_content(self.image_to_scan, "gem") |
29 | 30 |
|
30 | 31 | expect((ok, res)).to(be_successful_api_call)
|
31 | 32 | expect(res["content_type"]).to(equal("gem"))
|
32 | 33 |
|
33 | 34 | with it("is able to retrieve the python contents"):
|
34 |
| - ok, res = self.client.query_image_content("alpine:latest", "python") |
| 35 | + ok, res = self.client.query_image_content(self.image_to_scan, "python") |
35 | 36 |
|
36 | 37 | expect((ok, res)).to(be_successful_api_call)
|
37 | 38 | expect(res["content_type"]).to(equal("python"))
|
38 | 39 |
|
39 | 40 | with it("is able to retrieve the java contents"):
|
40 |
| - ok, res = self.client.query_image_content("alpine:latest", "java") |
| 41 | + ok, res = self.client.query_image_content(self.image_to_scan, "java") |
41 | 42 |
|
42 | 43 | expect((ok, res)).to(be_successful_api_call)
|
43 | 44 | expect(res["content_type"]).to(equal("java"))
|
44 | 45 |
|
45 | 46 | with it("is able to retrieve the files contents"):
|
46 |
| - ok, res = self.client.query_image_content("alpine:latest", "files") |
| 47 | + ok, res = self.client.query_image_content(self.image_to_scan, "files") |
47 | 48 |
|
48 | 49 | expect((ok, res)).to(be_successful_api_call)
|
49 | 50 | expect(res["content"]).to(
|
|
52 | 53 |
|
53 | 54 | with context("when the type is not in the supported list"):
|
54 | 55 | with it("returns an error indicating the type is incorrect"):
|
55 |
| - ok, res = self.client.query_image_content("alpine:latest", "Unknown") |
| 56 | + ok, res = self.client.query_image_content(self.image_to_scan, "Unknown") |
56 | 57 |
|
57 | 58 | expect((ok, res)).not_to(be_successful_api_call)
|
58 | 59 | expect(res).to(equal(
|
|
0 commit comments