Skip to content

Commit

Permalink
fix pydantic v1 ut
Browse files Browse the repository at this point in the history
  • Loading branch information
shabbywu committed Apr 7, 2024
1 parent 4a2974a commit a806045
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
35 changes: 35 additions & 0 deletions tests/spec/assets/image_json.pydantic_v1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"created": "2015-10-31T22:22:56.015925+00:00",
"author": "Alyssa P. Hacker &[email protected]&gt",
"architecture": "amd64",
"os": "linux",
"config": {
"User": "alice",
"Memory": 2048,
"MemorySwap": 4096,
"CpuShares": 8,
"ExposedPorts": {
"8080/tcp": {}
},
"Env": ["PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "FOO=docker_is_a_really", "BAR=great_tool_you_know"],
"Entrypoint": ["/bin/my-app-binary"],
"Cmd": ["--foreground", "--config", "/etc/my-app.d/default.cfg"],
"Volumes": {
"/var/job-result-data": {},
"/var/log/my-app-logs": {}
},
"WorkingDir": "/home/alice"
},
"rootfs": {
"diff_ids": ["sha256:c6f988f4874bb0add23a778f753c65efe992244e148a1d2ec2a8b664fb66bbd1", "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef"],
"type": "layers"
},
"history": [{
"created": "2015-10-31T22:22:54.690851+00:00",
"created_by": "/bin/sh -c #(nop) ADD file:a3bc1e842b69636f9df5256c49c5374fb4eef1e281fe3f282c65fb853ee171c5 in /"
}, {
"created": "2015-10-31T22:22:55.613815+00:00",
"created_by": "/bin/sh -c #(nop) CMD [\"sh\"]",
"empty_layer": true
}]
}
File renamed without changes.
5 changes: 4 additions & 1 deletion tests/spec/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,7 @@ def auth_response():

@pytest.fixture
def image_json_dict():
return json.loads((assets / "image_json.json").read_text())
if __version__.startswith("2."):
return json.loads((assets / "image_json.pydantic_v2.json").read_text())
else:
return json.loads((assets / "image_json.pydantic_v1.json").read_text())

0 comments on commit a806045

Please sign in to comment.