commit fbfc4b04a07b4984fdd5dbf053212559d7335e50
Author: Captain_Trojan <sejakm@students.zcu.cz>
Date:   Mon May 3 13:48:15 2021 +0200

    Re #8705 - Reformatting, test updates (discussed invalid branch returns 400).

diff --git a/tests/integration_tests/rest_api/certificates_test.py b/tests/integration_tests/rest_api/certificates_test.py
index 5690c62..d2a7e3c 100644
--- a/tests/integration_tests/rest_api/certificates_test.py
+++ b/tests/integration_tests/rest_api/certificates_test.py
@@ -42,18 +42,18 @@ def make_end_cert(server, parent, title="End certificate s.r.o.", usage=None):
         usage = ["SSL", "authentication", "digitalSignature"]
 
     return server.post("/api/certificates", content_type="application/json", json={
-    "CA": parent,
-    "subject": {
-        "C": "CZ",
-        "CN": title,
-        "L": "Pilsen",
-        "O": title,
-        "OU": "IT department",
-        "ST": "Pilsen Region",
-        "emailAddress": "end@ca.com"
-    },
-    "usage": usage,
-    "validityDays": 30
+        "CA": parent,
+        "subject": {
+            "C": "CZ",
+            "CN": title,
+            "L": "Pilsen",
+            "O": title,
+            "OU": "IT department",
+            "ST": "Pilsen Region",
+            "emailAddress": "end@ca.com"
+        },
+        "usage": usage,
+        "validityDays": 30
     })
 
 
@@ -703,7 +703,6 @@ def test_set_certificate_status(server):
 
 
 def test_certificate_deletion(server):
-
     # custom tree for checking node bijection w/ the actual certificate tree
     all_certs = {}
     parent_of = {}
@@ -788,7 +787,7 @@ def test_certificate_deletion(server):
 
             # twice, just in case
             ret = server.get(f"/api/certificates/{cert_id}")
-            assert ret.status_code == 205   # TODO change to 404 after someone gets the issue assigned and resolves it
+            assert ret.status_code == 205  # TODO change to 404 after someone gets the issue assigned and resolves it
             json = ret.json
             assert "data" in json
             assert "success" in json
@@ -910,6 +909,7 @@ def test_certificate_status_information_expired(server):
     assert ret.json["success"]
     assert ret.json["data"]["status"] == "expired"
 
+
 def test_create_with_key_with_pass_valid(server, cryptography_service):
     key_pass = "123456Seven"
     key_pem = cryptography_service.create_private_key(key_pass)
@@ -933,6 +933,7 @@ def test_create_with_key_with_pass_valid(server, cryptography_service):
     ret = server.post("/api/certificates", content_type="application/json", json=certificate)
     assert ret.status_code == 201
 
+
 def test_create_with_key_with_pass_invalid_1(server, cryptography_service):
     key_pass = "123456Seven"
     key_pem = cryptography_service.create_private_key(key_pass)
@@ -958,6 +959,7 @@ def test_create_with_key_with_pass_invalid_1(server, cryptography_service):
     assert ret.json["data"] == 'The provided passphrase does not match the provided key.'
     assert not ret.json["success"]
 
+
 def test_create_with_key_with_pass_invalid_2(server, cryptography_service):
     key_pass = "123456Seven"
 
@@ -982,11 +984,11 @@ def test_create_with_key_with_pass_invalid_2(server, cryptography_service):
     assert ret.json["data"] == 'The provided passphrase does not match the provided key.'
     assert not ret.json["success"]
 
+
 def test_create_with_key_no_pass(server, cryptography_service):
     key_pem = cryptography_service.create_private_key()
 
     certificate = {
-        "CA": 1,
         "subject": {
             "C": "CZ",
             "CN": "Rare Name",
@@ -1003,9 +1005,9 @@ def test_create_with_key_no_pass(server, cryptography_service):
     ret = server.post("/api/certificates", content_type="application/json", json=certificate)
     assert ret.status_code == 201
 
+
 def test_create_with_key_no_pass_invalid_1(server, cryptography_service):
     certificate = {
-        "CA": 1,
         "subject": {
             "C": "CZ",
             "CN": "Rare Name",
@@ -1023,6 +1025,7 @@ def test_create_with_key_no_pass_invalid_1(server, cryptography_service):
     assert ret.status_code == 400
     assert not ret.json["success"]
 
+
 def test_create_no_key_with_pass(server, cryptography_service):
     key_pass = "123456Seven"
 
@@ -1051,6 +1054,7 @@ def test_create_no_key_with_pass(server, cryptography_service):
     key_pem = ret.json["data"]
     assert cryptography_service.verify_key(key_pem, key_pass)
 
+
 def test_create_no_key_with_pass_invalid_1(server, cryptography_service):
     key_pass = "123456Seven"
 
@@ -1079,6 +1083,7 @@ def test_create_no_key_with_pass_invalid_1(server, cryptography_service):
     key_pem = ret.json["data"]
     assert not cryptography_service.verify_key(key_pem, "iforgotthepassagainimsorryfrowningface")
 
+
 def test_create_no_key_no_pass_invalid(server, cryptography_service):
     certificate = {
         "CA": 1,
@@ -1095,4 +1100,4 @@ def test_create_no_key_no_pass_invalid(server, cryptography_service):
         }
     }
     ret = server.post("/api/certificates", content_type="application/json", json=certificate)
-    assert ret.status_code == 201
+    assert ret.status_code == 400
