Exemple #1
0
def test_endpoints_options(
        config, expect_port, expect_web_path, expect_uuid_path):

    cfg = Config(shared_status)
    cfg.update([config])

    assert (expect_port, expect_web_path) == cfg.web_endpoint
    assert expect_uuid_path == cfg.uuid_path
Exemple #2
0
def test_misc_options(config, expect_profile, expect_stop_apps,
                      expect_expire_stopped, expect_log_level):

    cfg = Config(shared_status)
    cfg.update([config])

    assert cfg.default_profile == expect_profile
    assert cfg.stop_apps == expect_stop_apps
    assert cfg.expire_stopped == expect_expire_stopped
    assert cfg.console_log_level == expect_log_level
Exemple #3
0
def test_config_group_with_broken_and_noexist():
    conf_files = [empty_conf, 'boo/foo.yml']

    cfg = Config(shared_status)
    cnt = cfg.update(conf_files)

    assert cnt == 1
    assert cfg.secure == default_secure
Exemple #4
0
def test_config_group_with_broken():
    conf_files = [conf for conf, _ in good_secret_conf]
    conf_files.append(empty_conf)

    cfg = Config(shared_status)
    cnt = cfg.update(conf_files)

    assert cfg.secure == good_secret_conf[-1][1]
    assert cnt == len(good_secret_conf) + 1
Exemple #5
0
def test_api_timeout(config, expected_to):
    cfg = Config(shared_status)
    cfg.update([config])

    assert cfg.api_timeout == expected_to
Exemple #6
0
def test_config_group():
    cfg = Config(shared_status)
    cnt = cfg.update([conf for conf, _ in good_secret_conf])

    assert cfg.secure == good_secret_conf[-1][1]
    assert cnt == len(good_secret_conf)
Exemple #7
0
def test_broken_conf():
    cfg = Config(shared_status)
    cnt = cfg.update([empty_conf])

    assert cnt == 1
Exemple #8
0
def test_async_error(config, timeout):
    cfg = Config(shared_status)
    cfg.update([config])

    assert cfg.async_error_timeout_sec == timeout
Exemple #9
0
def test_secure_config(config_file, secure):
    cfg = Config(shared_status)
    cnt = cfg.update([config_file])

    assert cfg.secure == secure
    assert cnt == 1
Exemple #10
0
def test_control_filter(config, expected_filter):
    cfg = Config(shared_status)
    cfg.update([config])

    assert cfg.control_filter.as_dict() == expected_filter.as_dict()
Exemple #11
0
def test_feeadback_conf(config, path, enabled):
    cfg = Config(shared_status)
    cfg.update([config])

    assert cfg.feedback.unicorn_path == path
    assert cfg.feedback.unicorn_feedback == enabled
Exemple #12
0
def test_sentry_dsn(config, expect_dsn):
    cfg = Config(shared_status)
    cfg.update([config])

    assert cfg.sentry_dsn == expect_dsn
Exemple #13
0
def test_locator_endpoints(config, expect_loc_endp):
    cfg = Config(shared_status)
    cfg.update([config])

    assert cfg.locator_endpoints == expect_loc_endp
Exemple #14
0
def test_extra2(config, apps_poll_interval_sec, input_queue_size):
    cfg = Config(shared_status)
    cfg.update([config])

    assert cfg.apps_poll_interval_sec == apps_poll_interval_sec
    assert cfg.input_queue_size == input_queue_size
Exemple #15
0
def test_extra1(config, status_web_path, status_port):
    cfg = Config(shared_status)
    cfg.update([config])

    assert cfg.status_web_path == status_web_path
    assert cfg.status_port == status_port
Exemple #16
0
def test_service_names(config, expect_unicorn_name, expect_node_name):
    cfg = Config(shared_status)
    cfg.update([config])

    assert expect_unicorn_name == cfg.unicorn_name
    assert expect_node_name == cfg.node_name
Exemple #17
0
def test_secure_config(config_file, mod, cid, secret, update):
    cfg = Config(shared_status)
    cnt = cfg.update([config_file])

    assert cfg.secure == (mod, cid, secret, update)
    assert cnt == 1
Exemple #18
0
def test_control_filter_path(config, expected_filter_path):
    cfg = Config(shared_status)
    cfg.update([config])

    assert cfg.control_filter_path == expected_filter_path