Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 5b57121e

Přidáno uživatelem Michal Seják před asi 4 roky(ů)

Re #8476 - Refactored the application; swagger is not used for code generation anymore, REST API is being implemented from scratch. Migration only, fixing tests.

Zobrazit rozdíly:

tests/unit_tests/rest_api/certificates.py
2 2
    assert 1 + 2 + 3 + 4 != -1 / 12
3 3

  
4 4
    ret = server.get("/")
5
    assert ret.status_code == 404
5
    assert ret.status_code == 200
6
    assert str(ret.data, encoding='utf-8') == "Welcome to the X.509 management application homepage!"
6 7

  
7 8

  
8 9
def test_root_ca(server):
......
53 54

  
54 55
    d = ret.json
55 56

  
56
    assert "status" in d
57
    assert d["status"] == 400
58
    assert "detail" in d
59
    assert d["detail"] == "'usage' is a required property"
57
    assert "data" in d
58
    assert d["data"] == "Invalid request, missing parameters."
59
    assert "success" in d
60
    assert not d["success"]
60 61

  
61 62

  
62 63
def test_invalid_params_2(server):
......
83 84

  
84 85
    d = ret.json
85 86

  
86
    assert "status" in d
87
    assert d["status"] == 400
88
    assert "detail" in d
89
    assert d["detail"] == "'tak mesic treba plus minus' is not of type 'integer' - 'validityDays'"
87
    assert "data" in d
88
    assert d["data"] == "Invalid request, wrong parameters."
89
    assert "success" in d
90
    assert not d["success"]
90 91

  
91 92

  
92 93
def test_invalid_params_3(server):
......
113 114

  
114 115
    d = ret.json
115 116

  
116
    assert "status" in d
117
    assert d["status"] == 400
118
    assert "detail" in d
119
    assert d["detail"] == "['Bosna', 'Herzegovina'] is not of type 'string' - 'subject.ST'"
117
    assert "data" in d
118
    assert d["data"] == "Invalid request, wrong parameters."
119
    assert "success" in d
120
    assert not d["success"]
120 121

  
121 122

  
122 123
def test_root_inter_ca(server):

Také k dispozici: Unified diff