Skip to content
Snippets Groups Projects
Commit f22bd045 authored by Moul's avatar Moul
Browse files

[mod] #174: Remove GVASUBEndpoint

parent b47b7468
No related branches found
No related tags found
2 merge requests!157v1.0.0rc0: merge dev into master,!148#174: Remove GVASUBEndpoint
Pipeline #12975 failed
......@@ -702,16 +702,6 @@ class GVAEndpoint(Endpoint):
)
# required to type hint cls in classmethod
GVASUBEndpointType = TypeVar("GVASUBEndpointType", bound="GVASUBEndpoint")
class GVASUBEndpoint(GVAEndpoint):
API = "GVASUB"
endpoint_format = f"^GVASUB(?: (?P<flags>{const.ENDPOINT_FLAGS_REGEX}))?(?: (?P<host>{const.HOST_REGEX}))?(?: (?P<ipv4>{const.IPV4_REGEX}))?(?: (?P<ipv6>{const.IPV6_REGEX}))? (?P<port>{const.PORT_REGEX})(?: (?P<path>{const.PATH_REGEX}))?$"
re_inline = re.compile(endpoint_format)
MANAGED_API = {
BMAEndpoint.API: BMAEndpoint,
SecuredBMAEndpoint.API: SecuredBMAEndpoint,
......@@ -720,7 +710,6 @@ MANAGED_API = {
ESUserEndpoint.API: ESUserEndpoint,
ESSubscribtionEndpoint.API: ESSubscribtionEndpoint,
GVAEndpoint.API: GVAEndpoint,
GVASUBEndpoint.API: GVASUBEndpoint,
} # type: Dict[str, Any]
......
......@@ -42,7 +42,7 @@ def get_available_nodes(client: Client) -> List[List[Dict[str, Any]]]:
If node is down, you can select another node.
Warning : only nodes with BMAS, BASIC_MERKLED_API, GVA and GVASUB endpoint are selected
Warning: only nodes with BMAS, BASIC_MERKLED_API, and GVA endpoint are selected
and only those endpoints are available in the endpoint list
:param client: Client instance
......@@ -99,14 +99,13 @@ def get_available_nodes(client: Client) -> List[List[Dict[str, Any]]]:
# skip this node
continue
# filter endpoints to get only BMAS, BASIC_MERKLED_API, GVA or GVASUB
# filter endpoints to get only BMAS, BASIC_MERKLED_API or GVA
endpoints = [
endpoint
for endpoint in bma_peers[0]["endpoints"]
if endpoint.startswith("BMAS")
or endpoint.startswith("BASIC_MERKLED_API")
or endpoint.startswith("GVA")
or endpoint.startswith("GVASUB")
]
if len(endpoints) == 0:
# skip this node
......
......@@ -59,35 +59,6 @@ class TestEndpoint(unittest.TestCase):
self.assertEqual(gva_endpoint.inline(), endpoint_str)
def test_gva_subscription(self):
endpoint_str = "GVASUB test.domain.com 127.0.0.1 2001:0db8:0000:85a3:0000:0000:ac1f:8001 10902 gva"
gvasub_endpoint = endpoint.GVASUBEndpoint.from_inline(endpoint_str)
self.assertEqual(gvasub_endpoint.flags, "")
self.assertEqual(gvasub_endpoint.server, "test.domain.com")
self.assertEqual(gvasub_endpoint.ipv4, "127.0.0.1")
self.assertEqual(
gvasub_endpoint.ipv6, "2001:0db8:0000:85a3:0000:0000:ac1f:8001"
)
self.assertEqual(gvasub_endpoint.port, 10902)
self.assertEqual(gvasub_endpoint.path, "gva")
self.assertEqual(gvasub_endpoint.inline(), endpoint_str)
endpoint_str = "GVASUB S test.domain.com 10902 gva"
gvasub_endpoint = endpoint.GVASUBEndpoint.from_inline(endpoint_str)
self.assertEqual(gvasub_endpoint.flags, "S")
self.assertEqual(gvasub_endpoint.server, "test.domain.com")
self.assertEqual(gvasub_endpoint.ipv4, None)
self.assertEqual(gvasub_endpoint.ipv6, None)
self.assertEqual(gvasub_endpoint.port, 10902)
self.assertEqual(gvasub_endpoint.path, "gva")
assert gvasub_endpoint.inline(), endpoint_str
def test_gva_host_ipv4_mix_up(self):
endpoint_str = "GVA S 127.0.0.1 443 gva"
gva_endpoint = endpoint.GVAEndpoint.from_inline(endpoint_str)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment