Fixing UT for key_type on upload schema
This commit is contained in:
parent
7a226241db
commit
aaff0f7581
@ -376,7 +376,13 @@ class CertificateUploadInputSchema(CertificateCreationSchema):
|
||||
|
||||
@pre_load
|
||||
def load_data(self, data):
|
||||
data["key_type"] = utils.get_key_type_from_certificate(data["body"])
|
||||
if data.get("body"):
|
||||
try:
|
||||
data["key_type"] = utils.get_key_type_from_certificate(data["body"])
|
||||
except ValueError:
|
||||
raise ValidationError(
|
||||
"Public certificate presented is not valid.", field_names=["body"]
|
||||
)
|
||||
|
||||
|
||||
class CertificateExportInputSchema(LemurInputSchema):
|
||||
|
@ -55,6 +55,7 @@ def test_create_pending(pending_certificate, user, session):
|
||||
assert real_cert.notify == pending_certificate.notify
|
||||
assert real_cert.private_key == pending_certificate.private_key
|
||||
assert real_cert.external_id == "54321"
|
||||
assert real_cert.key_type == "RSA2048"
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
Loading…
Reference in New Issue
Block a user