Revize 41349ce9
Přidáno uživatelem Stanislav Král před téměř 4 roky(ů)
tests/integration_tests/rest_api/certificates_test.py | ||
---|---|---|
935 | 935 |
assert "success" in ret.json |
936 | 936 |
assert ret.json["success"] |
937 | 937 |
assert ret.json["data"]["status"] == "expired" |
938 |
|
|
939 |
|
|
940 |
def test_generate_identity(server): |
|
941 |
# make root CA |
|
942 |
ret = make_root_ca(server) |
|
943 |
# make intermediate CA |
|
944 |
ret = make_inter_ca(server, ret.json["data"]) |
|
945 |
# make end certificate |
|
946 |
ret = make_end_cert(server, ret.json["data"]) |
|
947 |
|
|
948 |
assert ret.status_code == 201 |
|
949 |
|
|
950 |
certificate = { |
|
951 |
"name": "Foo Identity", |
|
952 |
"password": "foobarbaz" |
|
953 |
} |
|
954 |
identity_ret = server.post(f"/api/certificates/{ret.json['data']}/identity", content_type="application/json", json=certificate) |
|
955 |
|
|
956 |
# assert valid HTTP status code and correct content type |
|
957 |
assert identity_ret.status_code == 200 |
|
958 |
assert identity_ret.content_type == "application/x-pkcs12" |
|
959 |
|
Také k dispozici: Unified diff
Re #8708 - Added a new integration test verifying valid status code and content type of /api/certificates/<id>/identity endpoint