Skip to content
Snippets Groups Projects
Commit ecaaea89 authored by Vincent Texier's avatar Vincent Texier
Browse files

[fix] #94 fix pylint alerts on tests.api package

parent 7faf2c69
No related branches found
No related tags found
1 merge request!66Merge of check_tests_and_examples to dev
......@@ -19,9 +19,9 @@ mypy:
# check code errors
pylint:
pylint --disable=C,R0913,R0903,R0902,R0914,R0912,R0915,W0613 --enable=C0121,C0202,C0321 --jobs=0 duniterpy/
pylint --disable=C,R0913,R0903,R0902,R0914,R0912,R0915,W0613 --enable=C0121,C0202,C0321 --jobs=0 tests/
pylint --disable=C,R0913,R0903,R0902,R0914,R0912,R0915,W0613 --enable=C0121,C0202,C0321 --jobs=0 examples/
pylint --disable=C,R0902,R0903,R0904,R0912,R0913,R0914,R0915,W0613 --enable=C0121,C0202,C0321 --jobs=0 duniterpy/
pylint --disable=C,R0902,R0903,R0904,R0912,R0913,R0914,R0915,W0613 --enable=C0121,C0202,C0321 --jobs=0 tests/
pylint --disable=C,R0902,R0903,R0904,R0912,R0913,R0914,R0915,W0613 --enable=C0121,C0202,C0321 --jobs=0 examples/
# check format
check-format:
......
import unittest
import jsonschema
from jsonschema import SchemaError, ValidationError
from duniterpy.api.bma.blockchain import parameters, block, current, hardship, memberships, newcomers, \
certifications, joiners, actives, leavers, ud, tx, BLOCK_NUMBERS_SCHEMA, BLOCK_SCHEMA, BLOCKS_SCHEMA, \
......@@ -35,7 +36,10 @@ class TestBmaBlockchain(WebFunctionalSetupMixin, unittest.TestCase):
"udReevalTime0": 1490094000,
"dtReeval": 15778800
}
try:
jsonschema.validate(json_sample, PARAMETERS_SCHEMA)
except (SchemaError, ValidationError):
raise self.failureException
def test_parameters_bad(self):
async def handler(request):
......@@ -43,7 +47,7 @@ class TestBmaBlockchain(WebFunctionalSetupMixin, unittest.TestCase):
return web.Response(body=b'{}', content_type='application/json')
async def go():
_, port, url = await self.create_server('GET', '/blockchain/parameters', handler)
_, port, _ = await self.create_server('GET', '/blockchain/parameters', handler)
with self.assertRaises(jsonschema.exceptions.ValidationError):
client = Client(BMAEndpoint("127.0.0.1", "", "", port))
await client(parameters)
......@@ -197,7 +201,10 @@ class TestBmaBlockchain(WebFunctionalSetupMixin, unittest.TestCase):
q4PCneYkcPH8AHEqEvqTtYQWslhlYO2B87aReuOl1uPczn5Q3VkZFAsU48ZTYryeyWp2nxdQojdFYhlAUNchAw==\n\
Transactions:\n"
}
try:
jsonschema.validate(json_sample, BLOCK_SCHEMA)
except (SchemaError, ValidationError):
raise self.failureException
def test_block_bad(self):
async def handler(request):
......@@ -205,7 +212,7 @@ class TestBmaBlockchain(WebFunctionalSetupMixin, unittest.TestCase):
return web.Response(body=b'{}', content_type='application/json')
async def go():
_, port, url = await self.create_server('GET', '/blockchain/block/100', handler)
_, port, _ = await self.create_server('GET', '/blockchain/block/100', handler)
with self.assertRaises(jsonschema.exceptions.ValidationError):
client = Client(BMAEndpoint("127.0.0.1", "", "", port))
await client(block, 100)
......@@ -219,7 +226,7 @@ class TestBmaBlockchain(WebFunctionalSetupMixin, unittest.TestCase):
return web.Response(body=b'{}', content_type='application/json')
async def go():
_, port, url = await self.create_server('GET', '/blockchain/current', handler)
_, port, _ = await self.create_server('GET', '/blockchain/current', handler)
with self.assertRaises(jsonschema.exceptions.ValidationError):
client = Client(BMAEndpoint("127.0.0.1", "", "", port))
await client(current)
......@@ -298,14 +305,20 @@ class TestBmaBlockchain(WebFunctionalSetupMixin, unittest.TestCase):
nKDTapgYR/nMEEkLaT4ygLCHlxmiACzi4Zv+gzRJN8hGdirQAMN1FNpJ2RVli4V4z+7y3lklPidOX2Aln8ZNBA==\n\
Transactions:\n"
}
try:
jsonschema.validate(json_sample, BLOCK_SCHEMA)
except (SchemaError, ValidationError):
raise self.failureException
def test_schema_hardship(self):
json_sample = {
"block": 40432,
"level": 4
}
try:
jsonschema.validate(json_sample, HARDSHIP_SCHEMA)
except (SchemaError, ValidationError):
raise self.failureException
def test_hardship_bad(self):
async def handler(request):
......@@ -313,7 +326,7 @@ class TestBmaBlockchain(WebFunctionalSetupMixin, unittest.TestCase):
return web.Response(body=b'{}', content_type='application/json')
async def go():
_, port, url = await self.create_server('GET',
_, port, _ = await self.create_server('GET',
'/blockchain/hardship/8Fi1VSTbjkXguwThF4v2ZxC5whK7pwG2vcGTkPUPjPGU',
handler)
with self.assertRaises(jsonschema.exceptions.ValidationError):
......@@ -347,7 +360,10 @@ class TestBmaBlockchain(WebFunctionalSetupMixin, unittest.TestCase):
},
]
}
try:
jsonschema.validate(json_sample, MEMBERSHIPS_SCHEMA)
except (SchemaError, ValidationError):
raise self.failureException
def test_membership_bad(self):
async def handler(request):
......@@ -355,7 +371,7 @@ class TestBmaBlockchain(WebFunctionalSetupMixin, unittest.TestCase):
return web.Response(body=b'{}', content_type='application/json')
async def go():
_, port, url = await self.create_server('GET',
_, port, _ = await self.create_server('GET',
'/blockchain/memberships'
'/8Fi1VSTbjkXguwThF4v2ZxC5whK7pwG2vcGTkPUPjPGU',
handler)
......@@ -372,7 +388,10 @@ class TestBmaBlockchain(WebFunctionalSetupMixin, unittest.TestCase):
"blocks": [223, 813]
}
}
try:
jsonschema.validate(json_sample, BLOCK_NUMBERS_SCHEMA)
except (SchemaError, ValidationError):
raise self.failureException
def test_newcomers_bad(self):
async def handler(request):
......@@ -380,7 +399,7 @@ class TestBmaBlockchain(WebFunctionalSetupMixin, unittest.TestCase):
return web.Response(body=b'{}', content_type='application/json')
async def go():
_, port, url = await self.create_server('GET', '/blockchain/with/newcomers', handler)
_, port, _ = await self.create_server('GET', '/blockchain/with/newcomers', handler)
with self.assertRaises(jsonschema.exceptions.ValidationError):
client = Client(BMAEndpoint("127.0.0.1", "", "", port))
await client(newcomers)
......@@ -394,7 +413,10 @@ class TestBmaBlockchain(WebFunctionalSetupMixin, unittest.TestCase):
"blocks": [223, 813]
}
}
try:
jsonschema.validate(json_sample, BLOCK_NUMBERS_SCHEMA)
except (SchemaError, ValidationError):
raise self.failureException
def test_certifications_bad(self):
async def handler(request):
......@@ -402,7 +424,7 @@ class TestBmaBlockchain(WebFunctionalSetupMixin, unittest.TestCase):
return web.Response(body=b'{}', content_type='application/json')
async def go():
_, port, url = await self.create_server('GET', '/blockchain/with/certs', handler)
_, port, _ = await self.create_server('GET', '/blockchain/with/certs', handler)
with self.assertRaises(jsonschema.exceptions.ValidationError):
client = Client(BMAEndpoint("127.0.0.1", "", "", port))
await client(certifications)
......@@ -416,7 +438,10 @@ class TestBmaBlockchain(WebFunctionalSetupMixin, unittest.TestCase):
"blocks": [223, 813]
}
}
try:
jsonschema.validate(json_sample, BLOCK_NUMBERS_SCHEMA)
except (SchemaError, ValidationError):
raise self.failureException
def test_joiners_bad(self):
async def handler(request):
......@@ -424,7 +449,7 @@ class TestBmaBlockchain(WebFunctionalSetupMixin, unittest.TestCase):
return web.Response(body=b'{}', content_type='application/json')
async def go():
_, port, url = await self.create_server('GET', '/blockchain/with/joiners', handler)
_, port, _ = await self.create_server('GET', '/blockchain/with/joiners', handler)
with self.assertRaises(jsonschema.exceptions.ValidationError):
client = Client(BMAEndpoint("127.0.0.1", "", "", port))
await client(joiners)
......@@ -438,7 +463,10 @@ class TestBmaBlockchain(WebFunctionalSetupMixin, unittest.TestCase):
"blocks": [223, 813]
}
}
try:
jsonschema.validate(json_sample, BLOCK_NUMBERS_SCHEMA)
except (SchemaError, ValidationError):
raise self.failureException
def test_actives_bad(self):
async def handler(request):
......@@ -446,7 +474,7 @@ class TestBmaBlockchain(WebFunctionalSetupMixin, unittest.TestCase):
return web.Response(body=b'{}', content_type='application/json')
async def go():
_, port, url = await self.create_server('GET', '/blockchain/with/actives', handler)
_, port, _ = await self.create_server('GET', '/blockchain/with/actives', handler)
with self.assertRaises(jsonschema.exceptions.ValidationError):
client = Client(BMAEndpoint("127.0.0.1", "", "", port))
await client(actives)
......@@ -460,7 +488,10 @@ class TestBmaBlockchain(WebFunctionalSetupMixin, unittest.TestCase):
"blocks": [223, 813]
}
}
try:
jsonschema.validate(json_sample, BLOCK_NUMBERS_SCHEMA)
except (SchemaError, ValidationError):
raise self.failureException
def test_leavers_bad(self):
async def handler(request):
......@@ -468,7 +499,7 @@ class TestBmaBlockchain(WebFunctionalSetupMixin, unittest.TestCase):
return web.Response(body=b'{}', content_type='application/json')
async def go():
_, port, url = await self.create_server('GET', '/blockchain/with/leavers', handler)
_, port, _ = await self.create_server('GET', '/blockchain/with/leavers', handler)
with self.assertRaises(jsonschema.exceptions.ValidationError):
client = Client(BMAEndpoint("127.0.0.1", "", "", port))
await client(leavers)
......@@ -482,7 +513,10 @@ class TestBmaBlockchain(WebFunctionalSetupMixin, unittest.TestCase):
"blocks": [223, 813]
}
}
try:
jsonschema.validate(json_sample, BLOCK_NUMBERS_SCHEMA)
except (SchemaError, ValidationError):
raise self.failureException
def test_schema_blocks(self):
json_sample = [
......@@ -598,7 +632,10 @@ class TestBmaBlockchain(WebFunctionalSetupMixin, unittest.TestCase):
InnerHash: 301236A7771CBDE30F253E2A42E34BF758450DADDDB37A832328701B04213A59\nNonce: 1\n"
}
]
try:
jsonschema.validate(json_sample, BLOCKS_SCHEMA)
except (SchemaError, ValidationError):
raise self.failureException
def test_ud_bad(self):
async def handler(request):
......@@ -606,7 +643,7 @@ class TestBmaBlockchain(WebFunctionalSetupMixin, unittest.TestCase):
return web.Response(body=b'{}', content_type='application/json')
async def go():
_, port, url = await self.create_server('GET', '/blockchain/with/ud', handler)
_, port, _ = await self.create_server('GET', '/blockchain/with/ud', handler)
with self.assertRaises(jsonschema.exceptions.ValidationError):
client = Client(BMAEndpoint("127.0.0.1", "", "", port))
await client(ud)
......@@ -620,7 +657,10 @@ class TestBmaBlockchain(WebFunctionalSetupMixin, unittest.TestCase):
"blocks": [223, 813]
}
}
try:
jsonschema.validate(json_sample, BLOCK_NUMBERS_SCHEMA)
except (SchemaError, ValidationError):
raise self.failureException
def test_tx_bad(self):
async def handler(request):
......@@ -628,7 +668,7 @@ class TestBmaBlockchain(WebFunctionalSetupMixin, unittest.TestCase):
return web.Response(body=b'{}', content_type='application/json')
async def go():
_, port, url = await self.create_server('GET', '/blockchain/with/tx', handler)
_, port, _ = await self.create_server('GET', '/blockchain/with/tx', handler)
with self.assertRaises(jsonschema.exceptions.ValidationError):
client = Client(BMAEndpoint("127.0.0.1", "", "", port))
await client(tx)
......
import unittest
import jsonschema
from jsonschema import ValidationError, SchemaError
from duniterpy.api.bma import network
from duniterpy.api.client import Client
......@@ -22,7 +23,10 @@ class TestBmaNetwork(WebFunctionalSetupMixin, unittest.TestCase):
],
"signature": "42yQm4hGTJYWkPg39hQAUgP6S6EQ4vTfXdJuxKEHL1ih6YHiDL2hcwrFgBHjXLRgxRhj2VNVqqc6b4JayKqTE14r"
}
try:
jsonschema.validate(json_sample, network.PEERING_SCHEMA)
except (SchemaError, ValidationError):
raise self.failureException
def test_peering_bad(self):
async def handler(request):
......@@ -30,7 +34,7 @@ class TestBmaNetwork(WebFunctionalSetupMixin, unittest.TestCase):
return web.Response(body=b'{}', content_type='application/json')
async def go():
_, port, url = await self.create_server('GET', '/network/peering', handler)
_, port, _ = await self.create_server('GET', '/network/peering', handler)
with self.assertRaises(jsonschema.exceptions.ValidationError):
client = Client(BMAEndpoint("127.0.0.1", "", "", port))
await client(network.peering)
......@@ -45,7 +49,10 @@ class TestBmaNetwork(WebFunctionalSetupMixin, unittest.TestCase):
"leavesCount": 5,
"root": "114B6E61CB5BB93D862CA3C1DFA8B99E313E66E9"
}
try:
jsonschema.validate(json_sample, network.PEERS_SCHEMA)
except (SchemaError, ValidationError):
raise self.failureException
def test_peers_leaf(self):
json_sample = {
......@@ -62,7 +69,10 @@ class TestBmaNetwork(WebFunctionalSetupMixin, unittest.TestCase):
"signature": "42yQm4hGTJYWkPg39hQAUgP6S6EQ4vTfXdJuxKEHL1ih6YHiDL2hcwrFgBHjXLRgxRhj2VNVqqc6b4JayKqTE14r"
}
}
try:
jsonschema.validate(json_sample, network.PEERS_SCHEMA)
except (SchemaError, ValidationError):
raise self.failureException
def test_peers_bad(self):
async def handler(request):
......@@ -70,7 +80,7 @@ class TestBmaNetwork(WebFunctionalSetupMixin, unittest.TestCase):
return web.Response(body=b'{}', content_type='application/json')
async def go():
_, port, url = await self.create_server('GET', '/network/peering/peers', handler)
_, port, _ = await self.create_server('GET', '/network/peering/peers', handler)
with self.assertRaises(jsonschema.exceptions.ValidationError):
client = Client(BMAEndpoint("127.0.0.1", "", "", port))
await client(network.peers)
......@@ -103,7 +113,10 @@ class TestBmaNetwork(WebFunctionalSetupMixin, unittest.TestCase):
"step": 2}
]
}
try:
jsonschema.validate(json_sample, network.WS2P_HEADS_SCHEMA)
except (SchemaError, ValidationError):
raise self.failureException
def test_ws2p_heads_bad(self):
async def handler(request):
......@@ -111,7 +124,7 @@ class TestBmaNetwork(WebFunctionalSetupMixin, unittest.TestCase):
return web.Response(body=b'{}', content_type='application/json')
async def go():
_, port, url = await self.create_server('GET', '/network/ws2p/heads', handler)
_, port, _ = await self.create_server('GET', '/network/ws2p/heads', handler)
with self.assertRaises(jsonschema.ValidationError):
client = Client(BMAEndpoint("127.0.0.1", "", "", port))
await client(network.ws2p_heads)
......
import unittest
import jsonschema
from jsonschema import SchemaError, ValidationError
from duniterpy.api.bma.tx import history, sources, blocks, HISTORY_SCHEMA, SOURCES_SCHEMA
from duniterpy.api.client import Client
......@@ -140,7 +141,10 @@ class TestBmaTx(WebFunctionalSetupMixin, unittest.TestCase):
],
}
}
try:
jsonschema.validate(json_sample, HISTORY_SCHEMA)
except (SchemaError, ValidationError):
raise self.failureException
def test_bma_tx_history_bad(self):
async def handler(request):
......@@ -148,7 +152,7 @@ class TestBmaTx(WebFunctionalSetupMixin, unittest.TestCase):
return web.Response(body=b'{}', content_type='application/json')
async def go():
_, port, url = await self.create_server('GET', '/tx/history/pubkey', handler)
_, port, _ = await self.create_server('GET', '/tx/history/pubkey', handler)
with self.assertRaises(jsonschema.exceptions.ValidationError):
client = Client(BMAEndpoint("127.0.0.1", "", "", port))
await client(history, 'pubkey')
......@@ -162,7 +166,7 @@ class TestBmaTx(WebFunctionalSetupMixin, unittest.TestCase):
return web.Response(body=b'{}', content_type='application/json')
async def go():
_, port, url = await self.create_server('GET', '/tx/history/pubkey/blocks/0/100', handler)
_, port, _ = await self.create_server('GET', '/tx/history/pubkey/blocks/0/100', handler)
with self.assertRaises(jsonschema.exceptions.ValidationError):
client = Client(BMAEndpoint("127.0.0.1", "", "", port))
await client(blocks, 'pubkey', 0, 100)
......@@ -193,7 +197,10 @@ class TestBmaTx(WebFunctionalSetupMixin, unittest.TestCase):
}
]
}
try:
jsonschema.validate(json_sample, SOURCES_SCHEMA)
except (SchemaError, ValidationError):
raise self.failureException
def test_bma_tx_sources_bad(self):
async def handler(request):
......@@ -201,7 +208,7 @@ class TestBmaTx(WebFunctionalSetupMixin, unittest.TestCase):
return web.Response(body=b'{}', content_type='application/json')
async def go():
_, port, url = await self.create_server('GET', '/tx/sources/pubkey', handler)
_, port, _ = await self.create_server('GET', '/tx/sources/pubkey', handler)
with self.assertRaises(jsonschema.exceptions.ValidationError):
client = Client(BMAEndpoint("127.0.0.1", "", "", port))
await client(sources, 'pubkey')
......
......@@ -2,6 +2,7 @@ import json
import unittest
import jsonschema
from jsonschema import SchemaError, ValidationError
from duniterpy.api.bma.wot import lookup, members, certified_by, certifiers_of, REQUIREMENTS_SCHEMA, \
CERTIFICATIONS_SCHEMA, LOOKUP_SCHEMA, MEMBERS_SCHEMA
......@@ -159,7 +160,10 @@ class TestBmaWot(WebFunctionalSetupMixin, unittest.TestCase):
}
]
}
try:
jsonschema.validate(json_sample, LOOKUP_SCHEMA)
except (SchemaError, ValidationError):
raise self.failureException
def test_bma_wot_lookup_bad(self):
async def handler(request):
......@@ -167,7 +171,7 @@ class TestBmaWot(WebFunctionalSetupMixin, unittest.TestCase):
return web.Response(body=b'{}', content_type='application/json')
async def go():
_, port, url = await self.create_server('GET', '/wot/lookup/pubkey', handler)
_, port, _ = await self.create_server('GET', '/wot/lookup/pubkey', handler)
with self.assertRaises(jsonschema.exceptions.ValidationError):
client = Client(BMAEndpoint("127.0.0.1", "", "", port))
await client(lookup, 'pubkey')
......@@ -183,7 +187,10 @@ class TestBmaWot(WebFunctionalSetupMixin, unittest.TestCase):
{"pubkey": "9HJ9VXa9wc6EKC6NkCi8b5TKWBot68VhYDg7kDk5T8Cz", "uid": "toc"}
]
}
try:
jsonschema.validate(MEMBERS_SCHEMA, json_sample)
except (SchemaError, ValidationError):
raise self.failureException
def test_bma_wot_members_bad(self):
async def handler(request):
......@@ -191,7 +198,7 @@ class TestBmaWot(WebFunctionalSetupMixin, unittest.TestCase):
return web.Response(body=b'{}', content_type='application/json')
async def go():
_, port, url = await self.create_server('GET', '/wot/members', handler)
_, port, _ = await self.create_server('GET', '/wot/members', handler)
with self.assertRaises(jsonschema.exceptions.ValidationError):
client = Client(BMAEndpoint("127.0.0.1", "", "", port))
await client(members)
......@@ -236,8 +243,10 @@ class TestBmaWot(WebFunctionalSetupMixin, unittest.TestCase):
}
]
}
try:
jsonschema.validate(json_sample, CERTIFICATIONS_SCHEMA)
jsonschema.validate(json_sample, CERTIFICATIONS_SCHEMA)
except (SchemaError, ValidationError):
raise self.failureException
def test_bma_wot_certifiers_bad(self):
async def handler(request):
......@@ -245,7 +254,7 @@ class TestBmaWot(WebFunctionalSetupMixin, unittest.TestCase):
return web.Response(body=b'{}', content_type='application/json')
async def go():
_, port, url = await self.create_server('GET', '/wot/certifiers-of/pubkey', handler)
_, port, _ = await self.create_server('GET', '/wot/certifiers-of/pubkey', handler)
with self.assertRaises(jsonschema.exceptions.ValidationError):
client = Client(BMAEndpoint("127.0.0.1", "", "", port))
await client(certifiers_of, 'pubkey')
......@@ -277,7 +286,7 @@ class TestBmaWot(WebFunctionalSetupMixin, unittest.TestCase):
}), "utf-8"), content_type='application/json')
async def go():
_, port, url = await self.create_server('GET', '/wot/certifiers-of/pubkey', handler)
_, port, _ = await self.create_server('GET', '/wot/certifiers-of/pubkey', handler)
with self.assertRaises(jsonschema.exceptions.ValidationError):
client = Client(BMAEndpoint("127.0.0.1", "", "", port))
await client(certifiers_of, 'pubkey')
......@@ -291,7 +300,7 @@ class TestBmaWot(WebFunctionalSetupMixin, unittest.TestCase):
return web.Response(body=b'{}', content_type='application/json')
async def go():
_, port, url = await self.create_server('GET', '/wot/certified-by/pubkey', handler)
_, port, _ = await self.create_server('GET', '/wot/certified-by/pubkey', handler)
with self.assertRaises(jsonschema.exceptions.ValidationError):
client = Client(BMAEndpoint("127.0.0.1", "", "", port))
await client(certified_by, 'pubkey')
......@@ -342,4 +351,7 @@ class TestBmaWot(WebFunctionalSetupMixin, unittest.TestCase):
}
]
}
try:
jsonschema.validate(json_sample, REQUIREMENTS_SCHEMA)
except (SchemaError, ValidationError):
raise self.failureException
import unittest
from jsonschema import SchemaError, ValidationError
from duniterpy.api.bma.ws import WS_BLOCK_SCHEMA, WS_PEER_SCHEMA
from duniterpy.api.client import parse_text
from tests.api.webserver import WebFunctionalSetupMixin
......@@ -82,7 +84,10 @@ class TestBmaWebsocket(WebFunctionalSetupMixin, unittest.TestCase):
"signature": "H41/8OGV2W4CLKbE35kk5t1HJQsb3jEM0/QGLUf80CwJvGZf3HvVCcNtHPUFoUBKEDQO9mPK3KJkqOoxHpqHCw=="
}
"""
try:
parse_text(json_sample, WS_BLOCK_SCHEMA)
except (SchemaError, ValidationError):
raise self.failureException
def test_peer(self):
json_sample = """{
......
......@@ -8,6 +8,19 @@ from aiohttp import web
# Thanks to aiohttp tests courtesy
# Here is a nice mocking server
def find_unused_port() -> int:
"""
Return first free network port
:return:
"""
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(('127.0.0.1', 0))
port = s.getsockname()[1]
s.close()
return port
class WebFunctionalSetupMixin:
def setUp(self) -> None:
......@@ -28,13 +41,6 @@ class WebFunctionalSetupMixin:
finally:
asyncio.set_event_loop(None)
def find_unused_port(self) -> int:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(('127.0.0.1', 0))
port = s.getsockname()[1]
s.close()
return port
async def create_server(self, method: str, path: str, handler: Optional[Callable] = None,
ssl_ctx: Optional[ssl.SSLContext] = None) -> Tuple[web.Application, int, str]:
"""
......@@ -51,7 +57,7 @@ class WebFunctionalSetupMixin:
await self.runner.setup()
port = self.find_unused_port()
port = find_unused_port()
site = web.TCPSite(self.runner, '127.0.0.1', port)
await site.start()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment