Skip to content
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
2 changes: 1 addition & 1 deletion client/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from .client import ArkClient # noqa
from .client import Client # noqa
2 changes: 1 addition & 1 deletion client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from client.api.votes import Votes
from client.api.wallets import Wallets

class ArkClient(object):
class Client(object):

def __init__(self, hosts: Union[str, ClientHosts]):
"""
Expand Down
6 changes: 3 additions & 3 deletions tests/api/test_api_nodes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import responses
from client import ArkClient
from client import Client


def test_api_nodes_calls_correct_url():
Expand All @@ -10,7 +10,7 @@ def test_api_nodes_calls_correct_url():
status=200
)

client = ArkClient('http://127.0.0.1:4002/api')
client = Client('http://127.0.0.1:4002/api')
client.api_nodes.all()
assert len(responses.calls) == 1
assert responses.calls[0].request.url == (
Expand All @@ -26,7 +26,7 @@ def test_api_nodes_calls_correct_url_with_params():
status=200
)

client = ArkClient('http://127.0.0.1:4002/api')
client = Client('http://127.0.0.1:4002/api')
client.api_nodes.all({
'query_param1': 'value1',
'query_param2': 'value2',
Expand Down
4 changes: 2 additions & 2 deletions tests/api/test_blockchain.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import responses
from client import ArkClient
from client import Client


def test_blockchain_calls_correct_url():
Expand All @@ -10,7 +10,7 @@ def test_blockchain_calls_correct_url():
status=200
)

client = ArkClient('http://127.0.0.1:4002/api')
client = Client('http://127.0.0.1:4002/api')
client.blockchain.blockchain()
assert len(responses.calls) == 1
assert responses.calls[0].request.url == 'http://127.0.0.1:4002/api/blockchain'
14 changes: 7 additions & 7 deletions tests/api/test_blocks.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import responses

from client import ArkClient
from client import Client


def test_all_calls_correct_url():
Expand All @@ -11,7 +11,7 @@ def test_all_calls_correct_url():
status=200
)

client = ArkClient('http://127.0.0.1:4002/api')
client = Client('http://127.0.0.1:4002/api')
client.blocks.all()
assert len(responses.calls) == 1
assert responses.calls[0].request.url == (
Expand All @@ -27,7 +27,7 @@ def test_all_calls_correct_url_with_params():
status=200
)

client = ArkClient('http://127.0.0.1:4002/api')
client = Client('http://127.0.0.1:4002/api')
client.blocks.all({
'page': 5,
'limit': 69,
Expand All @@ -52,7 +52,7 @@ def test_get_calls_correct_url():
status=200
)

client = ArkClient('http://127.0.0.1:4002/api')
client = Client('http://127.0.0.1:4002/api')
client.blocks.get(block_id)

assert len(responses.calls) == 1
Expand All @@ -69,7 +69,7 @@ def test_first_calls_correct_url():
status=200
)

client = ArkClient('http://127.0.0.1:4002/api')
client = Client('http://127.0.0.1:4002/api')
client.blocks.first()

assert len(responses.calls) == 1
Expand All @@ -86,7 +86,7 @@ def test_last_calls_correct_url():
status=200
)

client = ArkClient('http://127.0.0.1:4002/api')
client = Client('http://127.0.0.1:4002/api')
client.blocks.last()

assert len(responses.calls) == 1
Expand All @@ -106,7 +106,7 @@ def test_transactions_calls_correct_url_with_params():
status=200
)

client = ArkClient('http://127.0.0.1:4002/api')
client = Client('http://127.0.0.1:4002/api')
client.blocks.transactions(block_id, {
'page': 5,
'limit': 69,
Expand Down
4 changes: 2 additions & 2 deletions tests/api/test_commits.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import responses
from client import ArkClient
from client import Client


@responses.activate
Expand All @@ -11,7 +11,7 @@ def test_show_calls_correct_url():
status=200
)

client = ArkClient('http://127.0.0.1:4002/api')
client = Client('http://127.0.0.1:4002/api')
client.commits.get(1)
assert len(responses.calls) == 1
assert responses.calls[0].request.url == 'http://127.0.0.1:4002/api/commits/1'
6 changes: 3 additions & 3 deletions tests/api/test_contracts.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import responses
from client import ArkClient
from client import Client


def test_all_calls_correct_url():
Expand All @@ -10,7 +10,7 @@ def test_all_calls_correct_url():
status=200
)

client = ArkClient('http://127.0.0.1:4002/api')
client = Client('http://127.0.0.1:4002/api')
client.contracts.all()
assert len(responses.calls) == 1
assert responses.calls[0].request.url == 'http://127.0.0.1:4002/api/contracts'
Expand All @@ -24,7 +24,7 @@ def test_abi_calls_correct_url():
status=200
)

client = ArkClient('http://127.0.0.1:4002/api')
client = Client('http://127.0.0.1:4002/api')
client.contracts.abi('consensus', 'some-address')
assert len(responses.calls) == 1
assert responses.calls[0].request.url == 'http://127.0.0.1:4002/api/contracts/consensus/some-address/abi'
4 changes: 2 additions & 2 deletions tests/api/test_evm.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import json
import responses

from client import ArkClient
from client import Client


def test_eth_call_methods_correct_url():
Expand All @@ -12,7 +12,7 @@ def test_eth_call_methods_correct_url():
status=200
)

client = ArkClient('http://127.0.0.1:4002/evm/api')
client = Client('http://127.0.0.1:4002/evm/api')
client.evm.call({
'method': 'eth_call',
'params': [[{ 'random': 'data' }], 'latest'],
Expand Down
14 changes: 7 additions & 7 deletions tests/api/test_node.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import responses

from client import ArkClient
from client import Client


def test_status_calls_correct_url():
Expand All @@ -11,7 +11,7 @@ def test_status_calls_correct_url():
status=200
)

client = ArkClient('http://127.0.0.1:4002/api')
client = Client('http://127.0.0.1:4002/api')
client.node.status()
assert len(responses.calls) == 1
assert responses.calls[0].request.url == (
Expand All @@ -27,7 +27,7 @@ def test_syncing_calls_correct_url():
status=200
)

client = ArkClient('http://127.0.0.1:4002/api')
client = Client('http://127.0.0.1:4002/api')
client.node.syncing()
assert len(responses.calls) == 1
assert responses.calls[0].request.url == (
Expand All @@ -43,7 +43,7 @@ def test_configuration_calls_correct_url():
status=200
)

client = ArkClient('http://127.0.0.1:4002/api')
client = Client('http://127.0.0.1:4002/api')
client.node.configuration()
assert len(responses.calls) == 1
assert responses.calls[0].request.url == (
Expand All @@ -59,7 +59,7 @@ def test_configuration_crypto_call_correct_url():
status=200
)

client = ArkClient('http://127.0.0.1:4002/api')
client = Client('http://127.0.0.1:4002/api')
client.node.crypto()
assert len(responses.calls) == 1
assert responses.calls[0].request.url == (
Expand All @@ -75,7 +75,7 @@ def test_fees_calls_correct_url():
status=200
)

client = ArkClient('http://127.0.0.1:4002/api')
client = Client('http://127.0.0.1:4002/api')
client.node.fees()
assert len(responses.calls) == 1
assert responses.calls[0].request.url == (
Expand All @@ -91,7 +91,7 @@ def test_fees_calls_correct_url_with_params():
status=200
)

client = ArkClient('http://127.0.0.1:4002/api')
client = Client('http://127.0.0.1:4002/api')
client.node.fees({'days': 14})
assert len(responses.calls) == 1
url = responses.calls[0].request.url
Expand Down
8 changes: 4 additions & 4 deletions tests/api/test_peers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import responses

from client import ArkClient
from client import Client


def test_all_calls_correct_url():
Expand All @@ -11,7 +11,7 @@ def test_all_calls_correct_url():
status=200
)

client = ArkClient('http://127.0.0.1:4002/api')
client = Client('http://127.0.0.1:4002/api')
client.peers.all()
assert len(responses.calls) == 1
assert responses.calls[0].request.url == (
Expand All @@ -27,7 +27,7 @@ def test_all_calls_correct_url_with_params():
status=200
)

client = ArkClient('http://127.0.0.1:4002/api')
client = Client('http://127.0.0.1:4002/api')
client.peers.all({
'os': 'a',
'status': 'live',
Expand Down Expand Up @@ -58,7 +58,7 @@ def test_get_calls_correct_url_with_ip():
status=200
)

client = ArkClient('http://127.0.0.1:4002/api')
client = Client('http://127.0.0.1:4002/api')
client.peers.get(ip)
assert len(responses.calls) == 1
assert responses.calls[0].request.url == (
Expand Down
14 changes: 7 additions & 7 deletions tests/api/test_receipts.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import responses
from client import ArkClient
from client import Client


def test_all_calls_correct_url():
Expand All @@ -10,7 +10,7 @@ def test_all_calls_correct_url():
status=200
)

client = ArkClient('http://127.0.0.1:4002/api')
client = Client('http://127.0.0.1:4002/api')
client.receipts.all()
assert len(responses.calls) == 1
assert responses.calls[0].request.url == (
Expand All @@ -26,7 +26,7 @@ def test_all_calls_correct_url_with_params():
status=200
)

client = ArkClient('http://127.0.0.1:4002/api')
client = Client('http://127.0.0.1:4002/api')
client.receipts.all({
'query_param1': 'value1',
'query_param2': 'value2',
Expand All @@ -47,7 +47,7 @@ def test_get_calls_correct_url():
status=200
)

client = ArkClient('http://127.0.0.1:4002/api')
client = Client('http://127.0.0.1:4002/api')
client.receipts.get(transaction_hash)
assert len(responses.calls) == 1
assert responses.calls[0].request.url == (
Expand All @@ -64,7 +64,7 @@ def test_get_calls_correct_url_with_params():
status=200
)

client = ArkClient('http://127.0.0.1:4002/api')
client = Client('http://127.0.0.1:4002/api')
client.receipts.get(transaction_hash, {'format': 'hex'})
assert len(responses.calls) == 1
url = responses.calls[0].request.url
Expand All @@ -80,7 +80,7 @@ def test_contracts_calls_correct_url():
status=200
)

client = ArkClient('http://127.0.0.1:4002/api')
client = Client('http://127.0.0.1:4002/api')
client.receipts.contracts()
assert len(responses.calls) == 1
assert responses.calls[0].request.url == (
Expand All @@ -96,7 +96,7 @@ def test_contracts_calls_correct_url_with_params():
status=200
)

client = ArkClient('http://127.0.0.1:4002/api')
client = Client('http://127.0.0.1:4002/api')
client.receipts.contracts({'status': 'success'})
assert len(responses.calls) == 1
url = responses.calls[0].request.url
Expand Down
10 changes: 5 additions & 5 deletions tests/api/test_rounds.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import responses
from client import ArkClient
from client import Client


def test_all_calls_correct_url():
Expand All @@ -10,7 +10,7 @@ def test_all_calls_correct_url():
status=200
)

client = ArkClient('http://127.0.0.1:4002/api')
client = Client('http://127.0.0.1:4002/api')
client.rounds.all()
assert len(responses.calls) == 1
assert responses.calls[0].request.url == (
Expand All @@ -26,7 +26,7 @@ def test_all_calls_correct_url_with_params():
status=200
)

client = ArkClient('http://127.0.0.1:4002/api')
client = Client('http://127.0.0.1:4002/api')
client.rounds.all({
'query_param1': 'value1',
'query_param2': 'value2',
Expand All @@ -47,7 +47,7 @@ def test_show_calls_correct_url():
status=200
)

client = ArkClient('http://127.0.0.1:4002/api')
client = Client('http://127.0.0.1:4002/api')
client.rounds.show(round_id)
assert len(responses.calls) == 1
assert responses.calls[0].request.url == (
Expand All @@ -64,7 +64,7 @@ def test_validators_calls_correct_url():
status=200
)

client = ArkClient('http://127.0.0.1:4002/api')
client = Client('http://127.0.0.1:4002/api')
client.rounds.validators(round_id)

assert len(responses.calls) == 1
Expand Down
Loading
Loading