def setUp(self): super(ConfigUtilTests, self).setUp() self.static_valid_config = configutil.ValidConfiguration( dict(node=['valid']), ) self.dynamic_valid_config = configutil.ValidConfiguration( dict(), lambda section_name: section_name == "node", lambda section_name, item_name: (section_name, item_name) == ("node", "valid"), )
def _common_valid_config(): return configutil.ValidConfiguration({ "connections": ( "tcp", ), "node": ( "log_gatherer.furl", "nickname", "reveal-ip-address", "tempdir", "timeout.disconnect", "timeout.keepalive", "tub.location", "tub.port", "web.port", "web.static", ), "i2p": ( "enabled", "i2p.configdir", "i2p.executable", "launch", "sam.port", "dest", "dest.port", "dest.private_key_file", ), "tor": ( "control.port", "enabled", "launch", "socks.port", "tor.executable", "onion", "onion.local_port", "onion.external_port", "onion.private_key_file", ), })
_client_config = configutil.ValidConfiguration( static_valid_sections={ "client": ( "helper.furl", "introducer.furl", "key_generator.furl", "mutable.format", "peers.preferred", "shares.happy", "shares.needed", "shares.total", "storage.plugins", ), "ftpd": ( "accounts.file", "accounts.url", "enabled", "port", ), "storage": ( "debug_discard", "enabled", "anonymous", "expire.cutoff_date", "expire.enabled", "expire.immutable", "expire.mode", "expire.mode", "expire.mutable", "expire.override_lease_duration", "readonly", "reserved_space", "storage_dir", "plugins", ), "sftpd": ( "accounts.file", "accounts.url", "enabled", "host_privkey_file", "host_pubkey_file", "port", ), "helper": ("enabled", ), }, is_valid_section=_is_valid_section, # Anything in a valid section is a valid item, for now. is_valid_item=lambda section, ignored: _is_valid_section(section), )