Пример #1
0
 async def go():
     endpoint = BMAEndpoint("", "", "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://[2001:0db8:0000:85a3:0000:0000:ac1f:8001]:9092/test/url")
     await session.close()
Пример #2
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()
Пример #3
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()
Пример #4
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()