🌐 AI搜索 & 代理 主页
Skip to content
This repository was archived by the owner on Apr 15, 2024. It is now read-only.

Commit 905b598

Browse files
committed
add tests for CONSUL_HTTP_ADDR with and without scheme and CONSUL_HTTP_SSL
Signed-off-by: Steven Armstrong <steven.armstrong@id.ethz.ch>
1 parent 9287fe7 commit 905b598

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/test_base.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,19 @@ def test_CONSUL_HTTP_ADDR(self):
6060
c = Consul.from_env()
6161
assert c.http.base_uri == CONSUL_HTTP_ADDR
6262

63+
def test_CONSUL_HTTP_ADDR_scheme_http(self):
64+
CONSUL_HTTP_ADDR = '127.0.0.23:4242'
65+
with self.environ(CONSUL_HTTP_ADDR=CONSUL_HTTP_ADDR):
66+
c = Consul.from_env()
67+
assert c.http.base_uri == 'http://'+ CONSUL_HTTP_ADDR
68+
69+
def test_CONSUL_HTTP_ADDR_with_CONSUL_HTTP_SSL(self):
70+
CONSUL_HTTP_ADDR = '127.0.0.23:4242'
71+
with self.environ(CONSUL_HTTP_ADDR=CONSUL_HTTP_ADDR,
72+
CONSUL_HTTP_SSL='true'):
73+
c = Consul.from_env()
74+
assert c.http.base_uri == 'https://'+ CONSUL_HTTP_ADDR
75+
6376
def test_CONSUL_HTTP_TOKEN(self):
6477
CONSUL_HTTP_TOKEN = '1bdc2cb4-9b02-4b3c-9df5-eb86214e1a6c'
6578
with self.environ(CONSUL_HTTP_TOKEN=CONSUL_HTTP_TOKEN):

0 commit comments

Comments
 (0)