Reload Static
This commit is contained in:
parent
fa9a9767c9
commit
89ab133997
4 changed files with 75 additions and 15 deletions
|
|
@ -8,9 +8,58 @@ def test_processor_static():
|
|||
ProcessorInterface.static_file = os.path.join(os.path.dirname(os.path.realpath(__file__)), "./fixtures/static.yml")
|
||||
static = ProcessorInterface.factory("static")
|
||||
|
||||
parsed_object = [
|
||||
{
|
||||
"hosts":{
|
||||
"host1.com.br":{
|
||||
"containers":[
|
||||
"container:5000"
|
||||
],
|
||||
"letsencrypt": True
|
||||
},
|
||||
"host2.com.br":{
|
||||
"containers":[
|
||||
"other:3000"
|
||||
]
|
||||
}
|
||||
},
|
||||
"port":80,
|
||||
"redirect":{
|
||||
"www.host1.com.br":"http://host1.com.br"
|
||||
}
|
||||
},
|
||||
{
|
||||
"hosts":{
|
||||
"host1.com.br":{
|
||||
"containers":[
|
||||
"container:80"
|
||||
]
|
||||
}
|
||||
},
|
||||
"port":443,
|
||||
"ssl": True
|
||||
},
|
||||
{
|
||||
"hosts":{
|
||||
"host3.com.br":{
|
||||
"containers":[
|
||||
"domain:8181"
|
||||
]
|
||||
}
|
||||
},
|
||||
"port":8080
|
||||
}
|
||||
]
|
||||
hosts = [
|
||||
'host1.com.br:80',
|
||||
'host2.com.br:80',
|
||||
'host1.com.br:443',
|
||||
'host3.com.br:8080'
|
||||
]
|
||||
|
||||
assert static.get_letsencrypt_hosts() is None
|
||||
assert static.get_parsed_object() == {}
|
||||
assert static.get_hosts() is None
|
||||
assert static.get_parsed_object() == parsed_object
|
||||
assert static.get_hosts() == hosts
|
||||
|
||||
haproxy_cfg = static.get_haproxy_conf()
|
||||
|
||||
|
|
@ -18,7 +67,7 @@ def test_processor_static():
|
|||
|
||||
# @todo: Static doesnt populate this fields
|
||||
assert static.get_letsencrypt_hosts() == []
|
||||
assert static.get_parsed_object() == {}
|
||||
assert static.get_hosts() == []
|
||||
assert static.get_parsed_object() == parsed_object
|
||||
assert static.get_hosts() == hosts
|
||||
|
||||
# test_processor_static()
|
||||
Loading…
Add table
Add a link
Reference in a new issue