Beispiel #1
0
 async def go():
     _, 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)
     await client.close()
 async def go():
     _, 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)
     await client.close()
Beispiel #3
0
 async def go():
     _, 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)
     await client.close()
Beispiel #4
0
 async def go():
     _, port, url = 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')
     await client.close()
Beispiel #5
0
 async def go():
     _, port, url = 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)
     await client.close()
Beispiel #6
0
        async def go():
            endpoint = BMAEndpoint("", "124.2.2.1", "", 9092)
            session = aiohttp.ClientSession()

            api = API(endpoint.conn_handler(session), )
            self.assertEqual(api.reverse_url("http", "/test/url"),
                             "http://124.2.2.1:9092/test/url")
            await session.close()
Beispiel #7
0
 async def go():
     _, 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")
     await client.close()
Beispiel #8
0
 async def go():
     _, port, url = 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)
     await client.close()
Beispiel #9
0
 async def go():
     endpoint = BMAEndpoint("test.com", "124.2.2.1",
                            "2001:0db8:0000:85a3:0000:0000:ac1f:8001 ",
                            9092)
     session = aiohttp.ClientSession()
     api = API(endpoint.conn_handler(session), )
     self.assertEqual(api.reverse_url("http", "/test/url"),
                      "http://test.com:9092/test/url")
     await session.close()
Beispiel #10
0
 async def go():
     _, port, url = await self.create_server(
         'GET', '/blockchain/memberships'
         '/8Fi1VSTbjkXguwThF4v2ZxC5whK7pwG2vcGTkPUPjPGU', handler)
     with self.assertRaises(jsonschema.exceptions.ValidationError):
         client = Client(BMAEndpoint("127.0.0.1", "", "", port))
         await client(memberships,
                      "8Fi1VSTbjkXguwThF4v2ZxC5whK7pwG2vcGTkPUPjPGU")
     await client.close()
 async def go():
     _, port, _ = await self.create_server(
         "GET",
         "/blockchain/hardship/8Fi1VSTbjkXguwThF4v2ZxC5whK7pwG2vcGTkPUPjPGU",
         handler,
     )
     with self.assertRaises(jsonschema.exceptions.ValidationError):
         client = Client(BMAEndpoint("127.0.0.1", "", "", port))
         await client(hardship,
                      "8Fi1VSTbjkXguwThF4v2ZxC5whK7pwG2vcGTkPUPjPGU")
     await client.close()
Beispiel #12
0
 async def go():
     _, port, url = 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)
     await client.close()