1
0
Fork 0

Added more unit tests

This commit is contained in:
Joao Gilberto Magalhaes 2022-08-25 19:37:02 -05:00
parent 733e73ae58
commit f007f857df
6 changed files with 325 additions and 5 deletions

24
src/tests/test_static.py Normal file
View file

@ -0,0 +1,24 @@
import pytest
import os
from functions import Functions
from processor import ProcessorInterface
from processor import Static
def test_processor_static():
ProcessorInterface.static_file = os.path.join(os.path.dirname(os.path.realpath(__file__)), "./fixtures/static.yml")
static = ProcessorInterface.factory("static")
assert static.get_letsencrypt_hosts() is None
assert static.get_parsed_object() == {}
assert static.get_hosts() is None
haproxy_cfg = static.get_haproxy_conf()
assert haproxy_cfg == Functions.load(os.path.join(os.path.dirname(os.path.realpath(__file__)), "./expected/static.txt"))
# @todo: Static doesnt populate this fields
assert static.get_letsencrypt_hosts() == []
assert static.get_parsed_object() == {}
assert static.get_hosts() == []
# test_processor_static()