File: conftest.py

package info (click to toggle)
hcloud-python 2.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,396 kB
  • sloc: python: 15,311; makefile: 43; javascript: 3
file content (103 lines) | stat: -rw-r--r-- 3,047 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
from __future__ import annotations

import pytest


@pytest.fixture()
def datacenter_response():
    return {
        "datacenter": {
            "id": 1,
            "name": "fsn1-dc8",
            "description": "Falkenstein 1 DC 8",
            "location": {
                "id": 1,
                "name": "fsn1",
                "description": "Falkenstein DC Park 1",
                "country": "DE",
                "city": "Falkenstein",
                "latitude": 50.47612,
                "longitude": 12.370071,
            },
            "server_types": {
                "supported": [1, 2, 3],
                "available": [1, 2, 3],
                "available_for_migration": [1, 2, 3],
            },
        }
    }


@pytest.fixture()
def two_datacenters_response():
    return {
        "datacenters": [
            {
                "id": 1,
                "name": "fsn1-dc8",
                "description": "Falkenstein 1 DC 8",
                "location": {
                    "id": 1,
                    "name": "fsn1",
                    "description": "Falkenstein DC Park 1",
                    "country": "DE",
                    "city": "Falkenstein",
                    "latitude": 50.47612,
                    "longitude": 12.370071,
                },
                "server_types": {
                    "supported": [1, 2, 3],
                    "available": [1, 2, 3],
                    "available_for_migration": [1, 2, 3],
                },
            },
            {
                "id": 2,
                "name": "nbg1-dc3",
                "description": "Nuremberg 1 DC 3",
                "location": {
                    "id": 2,
                    "name": "nbg1",
                    "description": "Nuremberg DC Park 1",
                    "country": "DE",
                    "city": "Nuremberg",
                    "latitude": 49.452102,
                    "longitude": 11.076665,
                },
                "server_types": {
                    "supported": [1, 2, 3],
                    "available": [1, 2, 3],
                    "available_for_migration": [1, 2, 3],
                },
            },
        ],
        "recommendation": 1,
    }


@pytest.fixture()
def one_datacenters_response():
    return {
        "datacenters": [
            {
                "id": 1,
                "name": "fsn1-dc8",
                "description": "Falkenstein 1 DC 8",
                "location": {
                    "id": 1,
                    "name": "fsn1",
                    "description": "Falkenstein DC Park 1",
                    "country": "DE",
                    "city": "Falkenstein",
                    "latitude": 50.47612,
                    "longitude": 12.370071,
                },
                "server_types": {
                    "supported": [1, 2, 3],
                    "available": [1, 2, 3],
                    "available_for_migration": [1, 2, 3],
                },
            }
        ],
        "recommendation": 1,
    }