Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Update region-specific typing tests and fixtures #387

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
269 changes: 269 additions & 0 deletions test/integration/fixtures/TestTypes_RegionSpecific.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,269 @@
---
version: 1
interactions:
- request:
body: ""
form: {}
headers:
Accept:
- application/json
Content-Type:
- application/json
User-Agent:
- linodego/dev https://github.com/linode/linodego
url: https://api.linode.com/v4beta/linode/types
method: GET
response:
body: '{"data": [{"id": "g6-nanode-1", "label": "Nanode 1GB", "price": {"hourly":
0.0075, "monthly": 5.0}, "region_prices": [{"id": "us-east", "hourly": 0.009,
"monthly": 6.0}], "addons": {"backups": {"price": {"hourly": 0.003, "monthly":
2.0}, "region_prices": [{"id": "us-east", "hourly": 0.0036, "monthly": 2.4}]}},
"memory": 1024, "disk": 25600, "transfer": 1000, "vcpus": 1, "gpus": 0, "network_out":
1000, "class": "nanode", "successor": null}, {"id": "g6-standard-1", "label":
"Linode 2GB", "price": {"hourly": 0.015, "monthly": 10.0}, "region_prices":
[{"id": "us-east", "hourly": 0.018, "monthly": 12.0}], "addons": {"backups":
{"price": {"hourly": 0.004, "monthly": 2.5}, "region_prices": [{"id": "us-east",
"hourly": 0.0048, "monthly": 3.0}]}}, "memory": 2048, "disk": 51200, "transfer":
2000, "vcpus": 1, "gpus": 0, "network_out": 2000, "class": "standard", "successor":
null}, {"id": "g6-standard-2", "label": "Linode 4GB", "price": {"hourly": 0.03,
"monthly": 20.0}, "region_prices": [{"id": "us-east", "hourly": 0.036, "monthly":
24.0}], "addons": {"backups": {"price": {"hourly": 0.008, "monthly": 5.0}, "region_prices":
[{"id": "us-east", "hourly": 0.0096, "monthly": 6.0}]}}, "memory": 4096, "disk":
81920, "transfer": 4000, "vcpus": 2, "gpus": 0, "network_out": 4000, "class":
"standard", "successor": null}, {"id": "g6-standard-4", "label": "Linode 8GB",
"price": {"hourly": 0.06, "monthly": 40.0}, "region_prices": [{"id": "us-east",
"hourly": 0.072, "monthly": 48.0}], "addons": {"backups": {"price": {"hourly":
0.015, "monthly": 10.0}, "region_prices": [{"id": "us-east", "hourly": 0.018,
"monthly": 12.0}]}}, "memory": 8192, "disk": 163840, "transfer": 5000, "vcpus":
4, "gpus": 0, "network_out": 5000, "class": "standard", "successor": null},
{"id": "g6-standard-6", "label": "Linode 16GB", "price": {"hourly": 0.12, "monthly":
80.0}, "region_prices": [{"id": "us-east", "hourly": 0.144, "monthly": 96.0}],
"addons": {"backups": {"price": {"hourly": 0.03, "monthly": 20.0}, "region_prices":
[{"id": "us-east", "hourly": 0.036, "monthly": 24.0}]}}, "memory": 16384, "disk":
327680, "transfer": 8000, "vcpus": 6, "gpus": 0, "network_out": 6000, "class":
"standard", "successor": null}, {"id": "g6-standard-8", "label": "Linode 32GB",
"price": {"hourly": 0.24, "monthly": 160.0}, "region_prices": [{"id": "us-east",
"hourly": 0.288, "monthly": 192.0}], "addons": {"backups": {"price": {"hourly":
0.06, "monthly": 40.0}, "region_prices": [{"id": "us-east", "hourly": 0.072,
"monthly": 48.0}]}}, "memory": 32768, "disk": 655360, "transfer": 16000, "vcpus":
8, "gpus": 0, "network_out": 7000, "class": "standard", "successor": null},
{"id": "g6-standard-16", "label": "Linode 64GB", "price": {"hourly": 0.48, "monthly":
320.0}, "region_prices": [{"id": "us-east", "hourly": 0.576, "monthly": 384.0}],
"addons": {"backups": {"price": {"hourly": 0.12, "monthly": 80.0}, "region_prices":
[{"id": "us-east", "hourly": 0.144, "monthly": 96.0}]}}, "memory": 65536, "disk":
1310720, "transfer": 20000, "vcpus": 16, "gpus": 0, "network_out": 9000, "class":
"standard", "successor": null}, {"id": "g6-standard-20", "label": "Linode 96GB",
"price": {"hourly": 0.72, "monthly": 480.0}, "region_prices": [{"id": "us-east",
"hourly": 0.864, "monthly": 576.0}], "addons": {"backups": {"price": {"hourly":
0.18, "monthly": 120.0}, "region_prices": [{"id": "us-east", "hourly": 0.216,
"monthly": 144.0}]}}, "memory": 98304, "disk": 1966080, "transfer": 20000, "vcpus":
20, "gpus": 0, "network_out": 10000, "class": "standard", "successor": null},
{"id": "g6-standard-24", "label": "Linode 128GB", "price": {"hourly": 0.96,
"monthly": 640.0}, "region_prices": [{"id": "us-east", "hourly": 1.152, "monthly":
768.0}], "addons": {"backups": {"price": {"hourly": 0.24, "monthly": 160.0},
"region_prices": [{"id": "us-east", "hourly": 0.288, "monthly": 192.0}]}}, "memory":
131072, "disk": 2621440, "transfer": 20000, "vcpus": 24, "gpus": 0, "network_out":
11000, "class": "standard", "successor": null}, {"id": "g6-standard-32", "label":
"Linode 192GB", "price": {"hourly": 1.44, "monthly": 960.0}, "region_prices":
[{"id": "us-east", "hourly": 1.728, "monthly": 1152.0}], "addons": {"backups":
{"price": {"hourly": 0.36, "monthly": 240.0}, "region_prices": [{"id": "us-east",
"hourly": 0.432, "monthly": 288.0}]}}, "memory": 196608, "disk": 3932160, "transfer":
20000, "vcpus": 32, "gpus": 0, "network_out": 12000, "class": "standard", "successor":
null}, {"id": "g7-highmem-1", "label": "Linode 24GB", "price": {"hourly": 0.09,
"monthly": 60.0}, "region_prices": [{"id": "us-east", "hourly": 0.108, "monthly":
72.0}], "addons": {"backups": {"price": {"hourly": 0.0075, "monthly": 5.0},
"region_prices": [{"id": "us-east", "hourly": 0.009, "monthly": 6.0}]}}, "memory":
24576, "disk": 20480, "transfer": 5000, "vcpus": 2, "gpus": 0, "network_out":
5000, "class": "highmem", "successor": null}, {"id": "g7-highmem-2", "label":
"Linode 48GB", "price": {"hourly": 0.18, "monthly": 120.0}, "region_prices":
[{"id": "us-east", "hourly": 0.216, "monthly": 144.0}], "addons": {"backups":
{"price": {"hourly": 0.015, "monthly": 10.0}, "region_prices": [{"id": "us-east",
"hourly": 0.018, "monthly": 12.0}]}}, "memory": 49152, "disk": 40960, "transfer":
6000, "vcpus": 2, "gpus": 0, "network_out": 6000, "class": "highmem", "successor":
null}, {"id": "g7-highmem-4", "label": "Linode 90GB", "price": {"hourly": 0.36,
"monthly": 240.0}, "region_prices": [{"id": "us-east", "hourly": 0.432, "monthly":
288.0}], "addons": {"backups": {"price": {"hourly": 0.03, "monthly": 20.0},
"region_prices": [{"id": "us-east", "hourly": 0.036, "monthly": 24.0}]}}, "memory":
92160, "disk": 92160, "transfer": 7000, "vcpus": 4, "gpus": 0, "network_out":
7000, "class": "highmem", "successor": null}, {"id": "g7-highmem-8", "label":
"Linode 150GB", "price": {"hourly": 0.72, "monthly": 480.0}, "region_prices":
[{"id": "us-east", "hourly": 0.864, "monthly": 576.0}], "addons": {"backups":
{"price": {"hourly": 0.06, "monthly": 40.0}, "region_prices": [{"id": "us-east",
"hourly": 0.072, "monthly": 48.0}]}}, "memory": 153600, "disk": 204800, "transfer":
8000, "vcpus": 8, "gpus": 0, "network_out": 8000, "class": "highmem", "successor":
null}, {"id": "g7-highmem-16", "label": "Linode 300GB", "price": {"hourly":
1.44, "monthly": 960.0}, "region_prices": [{"id": "us-east", "hourly": 1.728,
"monthly": 1152.0}], "addons": {"backups": {"price": {"hourly": 0.12, "monthly":
80.0}, "region_prices": [{"id": "us-east", "hourly": 0.144, "monthly": 96.0}]}},
"memory": 307200, "disk": 348160, "transfer": 9000, "vcpus": 16, "gpus": 0,
"network_out": 9000, "class": "highmem", "successor": null}, {"id": "g6-dedicated-2",
"label": "Dedicated 4GB", "price": {"hourly": 0.045, "monthly": 30.0}, "region_prices":
[{"id": "us-east", "hourly": 0.054, "monthly": 36.0}], "addons": {"backups":
{"price": {"hourly": 0.008, "monthly": 5.0}, "region_prices": [{"id": "us-east",
"hourly": 0.0096, "monthly": 6.0}]}}, "memory": 4096, "disk": 81920, "transfer":
4000, "vcpus": 2, "gpus": 0, "network_out": 4000, "class": "dedicated", "successor":
null}, {"id": "g6-dedicated-4", "label": "Dedicated 8GB", "price": {"hourly":
0.09, "monthly": 60.0}, "region_prices": [{"id": "us-east", "hourly": 0.108,
"monthly": 72.0}], "addons": {"backups": {"price": {"hourly": 0.015, "monthly":
10.0}, "region_prices": [{"id": "us-east", "hourly": 0.018, "monthly": 12.0}]}},
"memory": 8192, "disk": 163840, "transfer": 5000, "vcpus": 4, "gpus": 0, "network_out":
5000, "class": "dedicated", "successor": null}, {"id": "g6-dedicated-8", "label":
"Dedicated 16GB", "price": {"hourly": 0.18, "monthly": 120.0}, "region_prices":
[{"id": "us-east", "hourly": 0.216, "monthly": 144.0}], "addons": {"backups":
{"price": {"hourly": 0.03, "monthly": 20.0}, "region_prices": [{"id": "us-east",
"hourly": 0.036, "monthly": 24.0}]}}, "memory": 16384, "disk": 327680, "transfer":
8000, "vcpus": 8, "gpus": 0, "network_out": 6000, "class": "dedicated", "successor":
null}, {"id": "g6-dedicated-16", "label": "Dedicated 32GB", "price": {"hourly":
0.36, "monthly": 240.0}, "region_prices": [{"id": "us-east", "hourly": 0.432,
"monthly": 288.0}], "addons": {"backups": {"price": {"hourly": 0.06, "monthly":
40.0}, "region_prices": [{"id": "us-east", "hourly": 0.072, "monthly": 48.0}]}},
"memory": 32768, "disk": 655360, "transfer": 16000, "vcpus": 16, "gpus": 0,
"network_out": 7000, "class": "dedicated", "successor": null}, {"id": "g6-dedicated-32",
"label": "Dedicated 64GB", "price": {"hourly": 0.72, "monthly": 480.0}, "region_prices":
[{"id": "us-east", "hourly": 0.864, "monthly": 576.0}], "addons": {"backups":
{"price": {"hourly": 0.12, "monthly": 80.0}, "region_prices": [{"id": "us-east",
"hourly": 0.144, "monthly": 96.0}]}}, "memory": 65536, "disk": 1310720, "transfer":
20000, "vcpus": 32, "gpus": 0, "network_out": 8000, "class": "dedicated", "successor":
null}, {"id": "g6-dedicated-48", "label": "Dedicated 96GB", "price": {"hourly":
1.08, "monthly": 720.0}, "region_prices": [{"id": "us-east", "hourly": 1.296,
"monthly": 864.0}], "addons": {"backups": {"price": {"hourly": 0.18, "monthly":
120.0}, "region_prices": [{"id": "us-east", "hourly": 0.216, "monthly": 144.0}]}},
"memory": 98304, "disk": 1966080, "transfer": 20000, "vcpus": 48, "gpus": 0,
"network_out": 9000, "class": "dedicated", "successor": null}, {"id": "g6-sawhorse-64",
"label": "Sawhorse 192GB", "price": {"hourly": 4.5, "monthly": 3000.0}, "region_prices":
[{"id": "us-east", "hourly": 5.4, "monthly": 3600.0}], "addons": {"backups":
{"price": {"hourly": 0.0, "monthly": 0.0}, "region_prices": [{"id": "us-east",
"hourly": 0.0, "monthly": 0.0}]}}, "memory": 196608, "disk": 8388608, "transfer":
9000, "vcpus": 64, "gpus": 0, "network_out": 10000, "class": "sawhorse", "successor":
null}, {"id": "g6-dedicated-50", "label": "Dedicated 128GB", "price": {"hourly":
1.44, "monthly": 960.0}, "region_prices": [{"id": "us-east", "hourly": 1.728,
"monthly": 1152.0}], "addons": {"backups": {"price": {"hourly": 0.24, "monthly":
160.0}, "region_prices": [{"id": "us-east", "hourly": 0.288, "monthly": 192.0}]}},
"memory": 131072, "disk": 2560000, "transfer": 10000, "vcpus": 50, "gpus": 0,
"network_out": 10000, "class": "dedicated", "successor": null}, {"id": "g6-dedicated-56",
"label": "Dedicated 256GB", "price": {"hourly": 2.88, "monthly": 1920.0}, "region_prices":
[{"id": "us-east", "hourly": 3.456, "monthly": 2304.0}], "addons": {"backups":
{"price": {"hourly": 0.3, "monthly": 200.0}, "region_prices": [{"id": "us-east",
"hourly": 0.36, "monthly": 240.0}]}}, "memory": 262144, "disk": 5120000, "transfer":
11000, "vcpus": 56, "gpus": 0, "network_out": 11000, "class": "dedicated", "successor":
null}, {"id": "g6-dedicated-64", "label": "Dedicated 512GB", "price": {"hourly":
5.76, "monthly": 3840.0}, "region_prices": [{"id": "us-east", "hourly": 6.912,
"monthly": 4608.0}], "addons": {"backups": {"price": {"hourly": 0.36, "monthly":
240.0}, "region_prices": [{"id": "us-east", "hourly": 0.432, "monthly": 288.0}]}},
"memory": 524288, "disk": 7372800, "transfer": 12000, "vcpus": 64, "gpus": 0,
"network_out": 12000, "class": "dedicated", "successor": null}, {"id": "g1-gpu-rtx6000-1",
"label": "Dedicated 32GB + RTX6000 GPU x1", "price": {"hourly": 1.5, "monthly":
1000.0}, "region_prices": [{"id": "us-east", "hourly": 1.8, "monthly": 1200.0}],
"addons": {"backups": {"price": {"hourly": 0.06, "monthly": 40.0}, "region_prices":
[{"id": "us-east", "hourly": 0.072, "monthly": 48.0}]}}, "memory": 32768, "disk":
655360, "transfer": 16000, "vcpus": 8, "gpus": 0, "network_out": 10000, "class":
"gpu", "successor": null}, {"id": "g1-gpu-rtx6000-2", "label": "Dedicated 64GB
+ RTX6000 GPU x2", "price": {"hourly": 3.0, "monthly": 2000.0}, "region_prices":
[{"id": "us-east", "hourly": 3.6, "monthly": 2400.0}], "addons": {"backups":
{"price": {"hourly": 0.12, "monthly": 80.0}, "region_prices": [{"id": "us-east",
"hourly": 0.144, "monthly": 96.0}]}}, "memory": 65536, "disk": 1310720, "transfer":
20000, "vcpus": 16, "gpus": 0, "network_out": 10000, "class": "gpu", "successor":
null}, {"id": "g1-gpu-rtx6000-3", "label": "Dedicated 96GB + RTX6000 GPU x3",
"price": {"hourly": 4.5, "monthly": 3000.0}, "region_prices": [{"id": "us-east",
"hourly": 5.4, "monthly": 3600.0}], "addons": {"backups": {"price": {"hourly":
0.18, "monthly": 160.0}, "region_prices": [{"id": "us-east", "hourly": 0.216,
"monthly": 192.0}]}}, "memory": 98304, "disk": 1966080, "transfer": 20000, "vcpus":
20, "gpus": 0, "network_out": 10000, "class": "gpu", "successor": null}, {"id":
"g1-gpu-rtx6000-4", "label": "Dedicated 128GB + RTX6000 GPU x4", "price": {"hourly":
6.0, "monthly": 4000.0}, "region_prices": [{"id": "us-east", "hourly": 7.2,
"monthly": 4800.0}], "addons": {"backups": {"price": {"hourly": 0.24, "monthly":
320.0}, "region_prices": [{"id": "us-east", "hourly": 0.288, "monthly": 384.0}]}},
"memory": 131072, "disk": 2621440, "transfer": 20000, "vcpus": 24, "gpus": 0,
"network_out": 10000, "class": "gpu", "successor": null}, {"id": "g6-premium-2",
"label": "Premium 4GB", "price": {"hourly": 0.05, "monthly": 36.0}, "region_prices":
[{"id": "us-east", "hourly": 0.06, "monthly": 43.2}], "addons": {"backups":
{"price": {"hourly": 0.008, "monthly": 5.0}, "region_prices": [{"id": "us-east",
"hourly": 0.0096, "monthly": 6.0}]}}, "memory": 4096, "disk": 81920, "transfer":
4000, "vcpus": 2, "gpus": 0, "network_out": 4000, "class": "premium", "successor":
null}, {"id": "g6-premium-4", "label": "Premium 8GB", "price": {"hourly": 0.11,
"monthly": 72.0}, "region_prices": [{"id": "us-east", "hourly": 0.132, "monthly":
86.4}], "addons": {"backups": {"price": {"hourly": 0.015, "monthly": 10.0},
"region_prices": [{"id": "us-east", "hourly": 0.018, "monthly": 12.0}]}}, "memory":
8192, "disk": 163840, "transfer": 5000, "vcpus": 4, "gpus": 0, "network_out":
5000, "class": "premium", "successor": null}, {"id": "g6-premium-8", "label":
"Premium 16GB", "price": {"hourly": 0.22, "monthly": 144.0}, "region_prices":
[{"id": "us-east", "hourly": 0.264, "monthly": 172.8}], "addons": {"backups":
{"price": {"hourly": 0.03, "monthly": 20.0}, "region_prices": [{"id": "us-east",
"hourly": 0.036, "monthly": 24.0}]}}, "memory": 16384, "disk": 327680, "transfer":
6000, "vcpus": 8, "gpus": 0, "network_out": 6000, "class": "premium", "successor":
null}, {"id": "g6-premium-16", "label": "Premium 32GB", "price": {"hourly":
0.43, "monthly": 288.0}, "region_prices": [{"id": "us-east", "hourly": 0.516,
"monthly": 345.6}], "addons": {"backups": {"price": {"hourly": 0.06, "monthly":
40.0}, "region_prices": [{"id": "us-east", "hourly": 0.072, "monthly": 48.0}]}},
"memory": 32768, "disk": 655360, "transfer": 7000, "vcpus": 16, "gpus": 0, "network_out":
7000, "class": "premium", "successor": null}, {"id": "g6-premium-32", "label":
"Premium 64GB", "price": {"hourly": 0.86, "monthly": 576.0}, "region_prices":
[{"id": "us-east", "hourly": 1.032, "monthly": 691.2}], "addons": {"backups":
{"price": {"hourly": 0.12, "monthly": 80.0}, "region_prices": [{"id": "us-east",
"hourly": 0.144, "monthly": 96.0}]}}, "memory": 65536, "disk": 1310720, "transfer":
8000, "vcpus": 32, "gpus": 0, "network_out": 8000, "class": "premium", "successor":
null}, {"id": "g6-premium-48", "label": "Premium 96GB", "price": {"hourly":
1.3, "monthly": 864.0}, "region_prices": [{"id": "us-east", "hourly": 1.56,
"monthly": 1036.8}], "addons": {"backups": {"price": {"hourly": 0.18, "monthly":
120.0}, "region_prices": [{"id": "us-east", "hourly": 0.216, "monthly": 144.0}]}},
"memory": 98304, "disk": 1966080, "transfer": 9000, "vcpus": 48, "gpus": 0,
"network_out": 9000, "class": "premium", "successor": null}, {"id": "g6-premium-50",
"label": "Premium 128GB", "price": {"hourly": 1.73, "monthly": 1152.0}, "region_prices":
[{"id": "us-east", "hourly": 2.076, "monthly": 1382.4}], "addons": {"backups":
{"price": {"hourly": 0.24, "monthly": 160.0}, "region_prices": [{"id": "us-east",
"hourly": 0.288, "monthly": 192.0}]}}, "memory": 131072, "disk": 2560000, "transfer":
10000, "vcpus": 50, "gpus": 0, "network_out": 10000, "class": "premium", "successor":
null}, {"id": "g6-premium-56", "label": "Premium 256GB", "price": {"hourly":
3.46, "monthly": 2304.0}, "region_prices": [{"id": "us-east", "hourly": 4.152,
"monthly": 2764.8}], "addons": {"backups": {"price": {"hourly": 0.3, "monthly":
200.0}, "region_prices": [{"id": "us-east", "hourly": 0.36, "monthly": 240.0}]}},
"memory": 262144, "disk": 5120000, "transfer": 11000, "vcpus": 56, "gpus": 0,
"network_out": 11000, "class": "premium", "successor": null}, {"id": "g6-premium-64",
"label": "Premium 512GB", "price": {"hourly": 6.91, "monthly": 4608.0}, "region_prices":
[{"id": "us-east", "hourly": 8.292, "monthly": 5529.6}], "addons": {"backups":
{"price": {"hourly": 0.36, "monthly": 240.0}, "region_prices": [{"id": "us-east",
"hourly": 0.432, "monthly": 288.0}]}}, "memory": 524288, "disk": 7372800, "transfer":
12000, "vcpus": 64, "gpus": 0, "network_out": 12000, "class": "premium", "successor":
null}], "page": 1, "pages": 1, "results": 46}'
headers:
Access-Control-Allow-Credentials:
- "true"
Access-Control-Allow-Headers:
- Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter
Access-Control-Allow-Methods:
- HEAD, GET, OPTIONS, POST, PUT, DELETE
Access-Control-Allow-Origin:
- '*'
Access-Control-Expose-Headers:
- X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status
Cache-Control:
- private, max-age=900
- private, max-age=60, s-maxage=60
Content-Security-Policy:
- default-src 'none'
Content-Type:
- application/json
Server:
- nginx
Strict-Transport-Security:
- max-age=31536000
Vary:
- Accept-Encoding
- Authorization, X-Filter
- Authorization, X-Filter
X-Accepted-Oauth-Scopes:
- '*'
X-Content-Type-Options:
- nosniff
X-Frame-Options:
- DENY
- DENY
X-Oauth-Scopes:
- '*'
X-Ratelimit-Limit:
- "1200"
X-Xss-Protection:
- 1; mode=block
status: 200 OK
code: 200
duration: ""
5 changes: 4 additions & 1 deletion test/integration/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,11 @@ func TestTypes_RegionSpecific(t *testing.T) {

var targetType *linodego.LinodeType
for _, t := range types {
if t.RegionPrices != nil && len(t.RegionPrices) > 0 {
if t.RegionPrices != nil &&
len(t.RegionPrices) > 0 &&
t.RegionPrices[0].Hourly > 0 {
targetType = &t
break
}
}

Expand Down