def test_console_log_level_setter(): console_level = 100500 cfg = Config(shared_status) cfg.console_log_level = console_level assert cfg.console_log_level == console_level
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
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
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
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
def test_control_filter(config, expected_filter): cfg = Config(shared_status) cfg.update([config]) assert cfg.control_filter.as_dict() == expected_filter.as_dict()
def test_broken_conf(): cfg = Config(shared_status) cnt = cfg.update([empty_conf]) assert cnt == 1
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
def test_secure_config(config_file, secure): cfg = Config(shared_status) cnt = cfg.update([config_file]) assert cfg.secure == secure assert cnt == 1
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)
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
def test_async_error(config, timeout): cfg = Config(shared_status) cfg.update([config]) assert cfg.async_error_timeout_sec == timeout
def test_empty_config(): cfg = Config(shared_status) assert cfg.secure == default_secure
def test_control_filter_path(config, expected_filter_path): cfg = Config(shared_status) cfg.update([config]) assert cfg.control_filter_path == expected_filter_path
def test_locator_endpoints(config, expect_loc_endp): cfg = Config(shared_status) cfg.update([config]) assert cfg.locator_endpoints == expect_loc_endp
def test_sentry_dsn(config, expect_dsn): cfg = Config(shared_status) cfg.update([config]) assert cfg.sentry_dsn == expect_dsn
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
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
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
def test_api_timeout(config, expected_to): cfg = Config(shared_status) cfg.update([config]) assert cfg.api_timeout == expected_to
def test_set_control_fitter(expected_filter): cfg = Config(shared_status) cfg.control_filter = expected_filter assert cfg.control_filter.as_dict() == expected_filter.as_dict()