mirror of
https://github.com/aljazceru/python-teos.git
synced 2025-12-18 06:34:19 +01:00
tests - Adds test for get_default_rpc_port and removes useless tests
This commit is contained in:
@@ -74,6 +74,9 @@ def test_build_conf_only_default():
|
|||||||
else:
|
else:
|
||||||
assert v == DEFAULT_CONF[k].get("value")
|
assert v == DEFAULT_CONF[k].get("value")
|
||||||
|
|
||||||
|
# No field should have been overwritten
|
||||||
|
assert not conf_loader.overwritten_fields
|
||||||
|
|
||||||
|
|
||||||
def test_build_conf_with_conf_file(conf_file_conf):
|
def test_build_conf_with_conf_file(conf_file_conf):
|
||||||
default_conf_copy = deepcopy(DEFAULT_CONF)
|
default_conf_copy = deepcopy(DEFAULT_CONF)
|
||||||
@@ -90,6 +93,10 @@ def test_build_conf_with_conf_file(conf_file_conf):
|
|||||||
# If a value is in the conf file, it will overwrite the one in the default conf
|
# If a value is in the conf file, it will overwrite the one in the default conf
|
||||||
if k in conf_file_conf:
|
if k in conf_file_conf:
|
||||||
comp_v = conf_file_conf[k]
|
comp_v = conf_file_conf[k]
|
||||||
|
|
||||||
|
# Check that we have kept track of what's overwritten
|
||||||
|
assert k in conf_loader.overwritten_fields
|
||||||
|
|
||||||
else:
|
else:
|
||||||
comp_v = DEFAULT_CONF[k].get("value")
|
comp_v = DEFAULT_CONF[k].get("value")
|
||||||
|
|
||||||
@@ -115,6 +122,10 @@ def test_build_conf_with_command_line():
|
|||||||
# If a value is in the command line conf, it will overwrite the one in the default conf
|
# If a value is in the command line conf, it will overwrite the one in the default conf
|
||||||
if k in COMMAND_LINE_CONF:
|
if k in COMMAND_LINE_CONF:
|
||||||
comp_v = cmd_data[k]
|
comp_v = cmd_data[k]
|
||||||
|
|
||||||
|
# Check that we have kept track of what's overwritten
|
||||||
|
assert k in conf_loader.overwritten_fields
|
||||||
|
|
||||||
else:
|
else:
|
||||||
comp_v = DEFAULT_CONF[k].get("value")
|
comp_v = DEFAULT_CONF[k].get("value")
|
||||||
|
|
||||||
@@ -149,6 +160,10 @@ def test_build_conf_with_all(conf_file_conf):
|
|||||||
else:
|
else:
|
||||||
assert v == comp_v
|
assert v == comp_v
|
||||||
|
|
||||||
|
if k in cmd_data or k in conf_file_conf:
|
||||||
|
# Check that we have kept track of what's overwritten
|
||||||
|
assert k in conf_loader.overwritten_fields
|
||||||
|
|
||||||
|
|
||||||
def test_build_invalid_data(conf_file_conf):
|
def test_build_invalid_data(conf_file_conf):
|
||||||
# Lets first try with only default
|
# Lets first try with only default
|
||||||
|
|||||||
Reference in New Issue
Block a user