Total Complexity | 2 |
Total Lines | 39 |
Duplicated Lines | 0 % |
Changes | 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 |