Exemple #1
0
 def test_reverse_url_complete(self):
     endpoint = BMAEndpoint("test.com", "124.2.2.1",
                            "2001:0db8:0000:85a3:0000:0000:ac1f:8001 ",
                            9092)
     api = API(next(endpoint.conn_handler()), "any")
     self.assertEqual(api.reverse_url("http", "/test/url"),
                      "http://test.com:9092/any/test/url")
Exemple #2
0
 def test_reverse_url_only_ipv6(self):
     endpoint = BMAEndpoint(None, None,
                            "2001:0db8:0000:85a3:0000:0000:ac1f:8001", 9092)
     api = API(next(endpoint.conn_handler()), "any")
     self.assertEqual(
         api.reverse_url("http", "/test/url"),
         "http://[2001:0db8:0000:85a3:0000:0000:ac1f:8001]:9092/any/test/url"
     )
Exemple #3
0
 def test_reverse_url_only_ipv4(self):
     endpoint = BMAEndpoint(None, "124.2.2.1", None, 9092)
     api = API(next(endpoint.conn_handler()), "any")
     self.assertEqual(api.reverse_url("http", "/test/url"),
                      "http://124.2.2.1:9092/any/test/url")