Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
DuniterPy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
clients
python
DuniterPy
Commits
f22bd045
Commit
f22bd045
authored
3 years ago
by
Moul
Browse files
Options
Downloads
Patches
Plain Diff
[mod]
#174
: Remove GVASUBEndpoint
parent
b47b7468
No related branches found
No related tags found
2 merge requests
!157
v1.0.0rc0: merge dev into master
,
!148
#174: Remove GVASUBEndpoint
Pipeline
#12975
failed
3 years ago
Stage: checks
Stage: tests
Stage: release
Changes
3
Pipelines
6
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
duniterpy/api/endpoint.py
+0
-11
0 additions, 11 deletions
duniterpy/api/endpoint.py
duniterpy/helpers/network.py
+2
-3
2 additions, 3 deletions
duniterpy/helpers/network.py
tests/api/test_endpoints.py
+0
-29
0 additions, 29 deletions
tests/api/test_endpoints.py
with
2 additions
and
43 deletions
duniterpy/api/endpoint.py
+
0
−
11
View file @
f22bd045
...
...
@@ -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]
...
...
This diff is collapsed.
Click to expand it.
duniterpy/helpers/network.py
+
2
−
3
View file @
f22bd045
...
...
@@ -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 GVA
SUB
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 GVA
SUB
# 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
...
...
This diff is collapsed.
Click to expand it.
tests/api/test_endpoints.py
+
0
−
29
View file @
f22bd045
...
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment