test_openapi.test_openapi_spec_generation()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 2
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nop 0
dl 0
loc 2
rs 10
c 0
b 0
f 0
1
from yfrake.openapi.generator import generate_openapi_spec
2
from yfrake.openapi.utils import get_openapi_datatype
3
4
5
def test_openapi_spec_generation():
6
    generate_openapi_spec()
7
8
9
def test_datatype_matching():
10
    result = get_openapi_datatype(str)
11
    assert result == 'string'
12
    result = get_openapi_datatype(str())
13
    assert result == 'string'
14
15
    result = get_openapi_datatype(int)
16
    assert result == 'integer'
17
    result = get_openapi_datatype(int())
18
    assert result == 'integer'
19
20
    result = get_openapi_datatype(bool)
21
    assert result == 'boolean'
22
    result = get_openapi_datatype(bool())
23
    assert result == 'boolean'
24
25
    result = get_openapi_datatype(list)
26
    assert result == 'array'
27
    result = get_openapi_datatype(list())
28
    assert result == 'array'
29
30
    result = get_openapi_datatype(dict)
31
    assert result == 'object'
32
    result = get_openapi_datatype(dict())
33
    assert result == 'object'
34
35
    result = get_openapi_datatype(float)
36
    assert result == 'number'
37
    result = get_openapi_datatype(float())
38
    assert result == 'number'
39