-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add to_dict method to domain classes
- Loading branch information
Showing
3 changed files
with
259 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,193 @@ | ||
from __future__ import annotations | ||
|
||
import pytest | ||
|
||
|
||
@pytest.fixture() | ||
def server_dict(): | ||
return { | ||
"id": 35555937, | ||
"name": "tmp", | ||
"status": "running", | ||
"created": "2023-08-03T13:06:14+00:00", | ||
"public_net": { | ||
"ipv4": { | ||
"ip": "95.217.11.207", | ||
"blocked": False, | ||
"dns_ptr": "static.207.11.217.95.clients.your-server.de", | ||
"id": 36311011, | ||
}, | ||
"ipv6": { | ||
"ip": "2a01:4f9:c012:63c9::/64", | ||
"blocked": False, | ||
"dns_ptr": [], | ||
"id": 36311012, | ||
}, | ||
"floating_ips": [], | ||
"firewalls": [], | ||
}, | ||
"private_net": [], | ||
"server_type": { | ||
"id": 1, | ||
"name": "cx11", | ||
"description": "CX11", | ||
"cores": 1, | ||
"memory": 2.0, | ||
"disk": 20, | ||
"deprecated": False, | ||
"prices": [ | ||
{ | ||
"location": "fsn1", | ||
"price_hourly": { | ||
"net": "0.0052000000", | ||
"gross": "0.0061880000000000", | ||
}, | ||
"price_monthly": { | ||
"net": "3.2900000000", | ||
"gross": "3.9151000000000000", | ||
}, | ||
}, | ||
{ | ||
"location": "hel1", | ||
"price_hourly": { | ||
"net": "0.0052000000", | ||
"gross": "0.0061880000000000", | ||
}, | ||
"price_monthly": { | ||
"net": "3.2900000000", | ||
"gross": "3.9151000000000000", | ||
}, | ||
}, | ||
{ | ||
"location": "nbg1", | ||
"price_hourly": { | ||
"net": "0.0052000000", | ||
"gross": "0.0061880000000000", | ||
}, | ||
"price_monthly": { | ||
"net": "3.2900000000", | ||
"gross": "3.9151000000000000", | ||
}, | ||
}, | ||
], | ||
"storage_type": "local", | ||
"cpu_type": "shared", | ||
"architecture": "x86", | ||
"included_traffic": 21990232555520, | ||
"deprecation": None, | ||
}, | ||
"datacenter": { | ||
"id": 3, | ||
"name": "hel1-dc2", | ||
"description": "Helsinki 1 virtual DC 2", | ||
"location": { | ||
"id": 3, | ||
"name": "hel1", | ||
"description": "Helsinki DC Park 1", | ||
"country": "FI", | ||
"city": "Helsinki", | ||
"latitude": 60.169855, | ||
"longitude": 24.938379, | ||
"network_zone": "eu-central", | ||
}, | ||
"server_types": { | ||
"supported": [ | ||
1, | ||
3, | ||
5, | ||
7, | ||
9, | ||
22, | ||
23, | ||
24, | ||
25, | ||
26, | ||
33, | ||
34, | ||
35, | ||
36, | ||
37, | ||
38, | ||
45, | ||
93, | ||
94, | ||
95, | ||
], | ||
"available": [ | ||
1, | ||
3, | ||
5, | ||
7, | ||
9, | ||
22, | ||
23, | ||
24, | ||
25, | ||
26, | ||
33, | ||
34, | ||
35, | ||
36, | ||
37, | ||
38, | ||
], | ||
"available_for_migration": [ | ||
1, | ||
3, | ||
5, | ||
7, | ||
9, | ||
22, | ||
23, | ||
24, | ||
25, | ||
26, | ||
33, | ||
34, | ||
35, | ||
36, | ||
37, | ||
38, | ||
96, | ||
97, | ||
98, | ||
99, | ||
100, | ||
101, | ||
], | ||
}, | ||
}, | ||
"image": { | ||
"id": 114690387, | ||
"type": "system", | ||
"status": "available", | ||
"name": "debian-12", | ||
"description": "Debian 12", | ||
"image_size": None, | ||
"disk_size": 5, | ||
"created": "2023-06-13T06:00:02+00:00", | ||
"created_from": None, | ||
"bound_to": None, | ||
"os_flavor": "debian", | ||
"os_version": "12", | ||
"rapid_deploy": True, | ||
"protection": {"delete": False}, | ||
"deprecated": None, | ||
"labels": {}, | ||
"deleted": None, | ||
"architecture": "x86", | ||
}, | ||
"iso": None, | ||
"rescue_enabled": False, | ||
"locked": False, | ||
"backup_window": None, | ||
"outgoing_traffic": None, | ||
"ingoing_traffic": None, | ||
"included_traffic": 21990232555520, | ||
"protection": {"delete": False, "rebuild": False}, | ||
"labels": {}, | ||
"volumes": [], | ||
# "load_balancers": [], | ||
"primary_disk_size": 20, | ||
"placement_group": None, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters