digaws/tests/__init__.py

147 lines
3.3 KiB
Python
Raw Permalink Normal View History

2020-12-25 20:36:41 +00:00
import ipaddress
2024-06-08 11:43:41 +00:00
AWS_IP_RANGES = """
2020-12-25 20:36:41 +00:00
{
"syncToken": "1608245058",
"createDate": "2020-12-17-22-44-18",
"prefixes": [
{
"ip_prefix": "52.93.178.234/32",
"region": "us-west-1",
"service": "AMAZON",
"network_border_group": "us-west-1"
},
{
"ip_prefix": "52.94.76.0/22",
"region": "us-west-2",
"service": "AMAZON",
"network_border_group": "us-west-2"
}
],
"ipv6_prefixes": [
{
"ipv6_prefix": "2600:1f00:c000::/40",
"region": "us-west-1",
"service": "AMAZON",
"network_border_group": "us-west-1"
},
{
"ipv6_prefix": "2600:1f01:4874::/47",
"region": "us-west-2",
"service": "AMAZON",
"network_border_group": "us-west-2"
},
{
"ipv6_prefix": "2600:1f14:fff:f800::/53",
"region": "us-west-2",
"service": "ROUTE53_HEALTHCHECKS",
"network_border_group": "us-west-2"
},
{
"ipv6_prefix": "2600:1f14::/35",
"region": "us-west-2",
"service": "EC2",
"network_border_group": "us-west-2"
}
]
}
2024-06-08 11:43:41 +00:00
"""
2020-12-25 20:36:41 +00:00
AWS_IPV4_RANGES_OBJ = [
2024-06-08 11:43:41 +00:00
{
"ip_prefix": ipaddress.IPv4Network("52.93.178.234/32"),
"region": "us-west-1",
"service": "AMAZON",
"network_border_group": "us-west-1",
},
{
"ip_prefix": ipaddress.IPv4Network("52.94.76.0/22"),
"region": "us-west-2",
"service": "AMAZON",
"network_border_group": "us-west-2",
},
2020-12-25 20:36:41 +00:00
]
AWS_IPV6_RANGES_OBJ = [
2024-06-08 11:43:41 +00:00
{
"ipv6_prefix": ipaddress.IPv6Network("2600:1f00:c000::/40"),
"region": "us-west-1",
"service": "AMAZON",
"network_border_group": "us-west-1",
},
{
"ipv6_prefix": ipaddress.IPv6Network("2600:1f01:4874::/47"),
"region": "us-west-2",
"service": "AMAZON",
"network_border_group": "us-west-2",
},
{
"ipv6_prefix": ipaddress.IPv6Network("2600:1f14:fff:f800::/53"),
"region": "us-west-2",
"service": "ROUTE53_HEALTHCHECKS",
"network_border_group": "us-west-2",
},
{
"ipv6_prefix": ipaddress.IPv6Network("2600:1f14::/35"),
"region": "us-west-2",
"service": "EC2",
"network_border_group": "us-west-2",
},
2020-12-25 20:36:41 +00:00
]
2024-06-08 11:43:41 +00:00
LAST_MODIFIED_TIME = "Thu, 17 Dec 2020 23:22:33 GMT"
2020-12-25 20:36:41 +00:00
2024-06-08 11:43:41 +00:00
RESPONSE_PLAIN_PRINT = """Prefix: 52.94.76.0/22
2020-12-25 20:36:41 +00:00
Region: us-west-2
Service: AMAZON
Network border group: us-west-2
2024-06-08 11:43:41 +00:00
"""
2020-12-25 20:36:41 +00:00
2024-06-08 11:43:41 +00:00
RESPONSE_JSON_PRINT = """[
2020-12-25 20:36:41 +00:00
{
"ipv6_prefix": "2600:1f14:fff:f800::/53",
"region": "us-west-2",
"service": "ROUTE53_HEALTHCHECKS",
"network_border_group": "us-west-2"
},
{
"ipv6_prefix": "2600:1f14::/35",
"region": "us-west-2",
"service": "EC2",
"network_border_group": "us-west-2"
}
]
2024-06-08 11:43:41 +00:00
"""
2020-12-25 20:36:41 +00:00
2024-06-08 11:43:41 +00:00
RESPONSE_JSON_FIELDS_PRINT = """[
2020-12-26 12:31:05 +00:00
{
"service": "ROUTE53_HEALTHCHECKS",
"network_border_group": "us-west-2"
},
{
"service": "EC2",
"network_border_group": "us-west-2"
}
]
2024-06-08 11:43:41 +00:00
"""
2020-12-26 12:31:05 +00:00
2024-06-08 11:43:41 +00:00
RESPONSE_JSON_JOINED_PRINT = """[
2020-12-25 20:36:41 +00:00
{
"ip_prefix": "52.94.76.0/22",
"region": "us-west-2",
"service": "AMAZON",
"network_border_group": "us-west-2"
},
{
"ipv6_prefix": "2600:1f14:fff:f800::/53",
"region": "us-west-2",
"service": "ROUTE53_HEALTHCHECKS",
"network_border_group": "us-west-2"
},
{
"ipv6_prefix": "2600:1f14::/35",
"region": "us-west-2",
"service": "EC2",
"network_border_group": "us-west-2"
}
]
2024-06-08 11:43:41 +00:00
"""