Added test of initial_servers
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Kocsis Richárd 2020-05-13 17:15:55 +02:00
parent c46dbd8211
commit 547499d840

View File

@ -9,7 +9,7 @@ import requests
import requests.exceptions import requests.exceptions
import logging import logging
import os import os
import app
REDIS_URL = "redis://localhost/0" REDIS_URL = "redis://localhost/0"
REDIS_TIMEOUT = 2 REDIS_TIMEOUT = 2
@ -20,7 +20,7 @@ CURRENT_IPADDR = "192.168.1.50"
LOCAL_UUID = "testuuid1" LOCAL_UUID = "testuuid1"
os.environ["LOCAL_UUID"] = LOCAL_UUID os.environ["LOCAL_UUID"] = LOCAL_UUID
os.environ["INITIAL_SERVERS"] = "127.0.0.1,192.168.0.1,172.20.0.2"
@pytest.fixture @pytest.fixture
def redis_super_storage_instance(mocker): def redis_super_storage_instance(mocker):
@ -443,3 +443,13 @@ def test_cc_sync_all_error_logged(mocker, requests_mock, consumer_communicator_i
logging.error.assert_called_once() logging.error.assert_called_once()
# ========================================
# App
# ========================================
def test_app_get_initial_ip_list():
lst = app.get_initial_ip_list()
assert lst == ["127.0.0.1", "192.168.0.1", "172.20.0.2"]