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

[lint] Remove duplicate network/ws2p/heads BMA path

Kept the one in 'bma' module since the request is done on BMA API
Update the import in the test

S
parent 05db60c4
Branches
Tags
2 merge requests!128Release 0.62.0,!123#147: Support pylint v2.7.1 R0801 rule
...@@ -17,43 +17,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. ...@@ -17,43 +17,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import logging import logging
from duniterpy.api.client import Client
logger = logging.getLogger("duniter/network") logger = logging.getLogger("duniter/network")
MODULE = "network"
WS2P_HEADS_SCHEMA = {
"type": "object",
"properties": {
"heads": {
"type": "array",
"items": {
"type": "object",
"properties": {
"message": {"type": "string"},
"sig": {"type": "string"},
"messageV2": {"type": "string"},
"sigV2": {"type": "string"},
"step": {"type": "number"},
},
"required": ["message", "sig"],
},
}
},
"required": ["heads"],
}
def heads(client: Client):
"""
GET Certification data over a member
:param client: Client to connect to the api
:rtype: dict
"""
return client.get(MODULE + "/ws2p/heads", schema=WS2P_HEADS_SCHEMA)
WS2P_CONNECT_MESSAGE_SCHEMA = { WS2P_CONNECT_MESSAGE_SCHEMA = {
"type": "object", "type": "object",
......
...@@ -21,7 +21,7 @@ import unittest ...@@ -21,7 +21,7 @@ import unittest
import jsonschema import jsonschema
from duniterpy.api.client import parse_text from duniterpy.api.client import parse_text
from duniterpy.api.ws2p.network import WS2P_HEADS_SCHEMA from duniterpy.api.bma.network import WS2P_HEADS_SCHEMA
from duniterpy.api.ws2p.requests import ( from duniterpy.api.ws2p.requests import (
BLOCK_RESPONSE_SCHEMA, BLOCK_RESPONSE_SCHEMA,
ERROR_RESPONSE_SCHEMA, ERROR_RESPONSE_SCHEMA,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment