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 (153 lines) | stat: -rw-r--r-- 4,907 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
from __future__ import annotations

import pytest


@pytest.fixture()
def server_type_response():
    return {
        "server_type": {
            "id": 1,
            "name": "cx11",
            "description": "CX11",
            "cores": 1,
            "memory": 1,
            "disk": 25,
            "prices": [
                {
                    "location": "fsn1",
                    "price_hourly": {
                        "net": "1.0000000000",
                        "gross": "1.1900000000000000",
                    },
                    "price_monthly": {
                        "net": "1.0000000000",
                        "gross": "1.1900000000000000",
                    },
                }
            ],
            "storage_type": "local",
            "cpu_type": "shared",
            "architecture": "x86",
            "included_traffic": 21990232555520,
            "deprecated": True,
            "deprecation": {
                "announced": "2023-06-01T00:00:00+00:00",
                "unavailable_after": "2023-09-01T00:00:00+00:00",
            },
        }
    }


@pytest.fixture()
def two_server_types_response():
    return {
        "server_types": [
            {
                "id": 1,
                "name": "cx11",
                "description": "CX11",
                "cores": 1,
                "memory": 1,
                "disk": 25,
                "prices": [
                    {
                        "location": "fsn1",
                        "price_hourly": {
                            "net": "1.0000000000",
                            "gross": "1.1900000000000000",
                        },
                        "price_monthly": {
                            "net": "1.0000000000",
                            "gross": "1.1900000000000000",
                        },
                    }
                ],
                "storage_type": "local",
                "cpu_type": "shared",
                "architecture": "x86",
                "included_traffic": 21990232555520,
                "deprecated": True,
                "deprecation": {
                    "announced": "2023-06-01T00:00:00+00:00",
                    "unavailable_after": "2023-09-01T00:00:00+00:00",
                },
            },
            {
                "id": 2,
                "name": "cx21",
                "description": "CX21",
                "cores": 2,
                "memory": 4.0,
                "disk": 40,
                "prices": [
                    {
                        "location": "fsn1",
                        "price_hourly": {
                            "net": "0.0080000000",
                            "gross": "0.0095200000000000",
                        },
                        "price_monthly": {
                            "net": "4.9000000000",
                            "gross": "5.8310000000000000",
                        },
                    },
                    {
                        "location": "nbg1",
                        "price_hourly": {
                            "net": "0.0080000000",
                            "gross": "0.0095200000000000",
                        },
                        "price_monthly": {
                            "net": "4.9000000000",
                            "gross": "5.8310000000000000",
                        },
                    },
                ],
                "storage_type": "local",
                "cpu_type": "shared",
                "architecture": "x86",
                "included_traffic": 21990232555520,
                "deprecated": False,
                "deprecation": None,
            },
        ]
    }


@pytest.fixture()
def one_server_types_response():
    return {
        "server_types": [
            {
                "id": 1,
                "name": "cx11",
                "description": "CX11",
                "cores": 1,
                "memory": 1,
                "disk": 25,
                "prices": [
                    {
                        "location": "fsn1",
                        "price_hourly": {
                            "net": "1.0000000000",
                            "gross": "1.1900000000000000",
                        },
                        "price_monthly": {
                            "net": "1.0000000000",
                            "gross": "1.1900000000000000",
                        },
                    }
                ],
                "storage_type": "local",
                "cpu_type": "shared",
                "architecture": "x86",
                "included_traffic": 21990232555520,
                "deprecated": True,
                "deprecation": {
                    "announced": "2023-06-01T00:00:00+00:00",
                    "unavailable_after": "2023-09-01T00:00:00+00:00",
                },
            }
        ]
    }