def test_config_init__remote_config__schema_valid__no_overlapping_item( requests_mock): mock_instances = [{ "name": "cms", "display_name": "CMS", "mode": "replica", "$url": "http://localhost/rucio.json" }] mock_config = Struct(instances=mock_instances) remote_config = { "rucio_base_url": "https://rucio", "destination_rse": "SWAN-EOS", "rse_mount_path": "/eos/user/rucio", "path_begins_at": 1 } requests_mock.get("http://localhost/rucio.json", json=remote_config) config = Config(mock_config) expected_config = { "name": "cms", "display_name": "CMS", "mode": "replica", "$url": "http://localhost/rucio.json", "rucio_base_url": "https://rucio", "destination_rse": "SWAN-EOS", "rse_mount_path": "/eos/user/rucio", "path_begins_at": 1 } assert config.get_instance_config( 'cms') == expected_config, "Invalid remote config format"
def test_config_init__local_config__download_mode__schema_valid(): mock_instances = [{ "name": "atlas", "display_name": "ATLAS", "rucio_base_url": "https://rucio", "mode": "download", "rucio_ca_cert": '/opt/rucio.pem' }] mock_config = Struct(instances=mock_instances) config = Config(mock_config) assert config.get_instance_config( 'atlas') == mock_instances[0], "Invalid instances"
def test_config_init__local_config__replica_mode__schema_valid(): mock_instances = [{ "name": "atlas", "display_name": "ATLAS", "rucio_base_url": "https://rucio", "mode": "replica", "destination_rse": "SWAN-EOS", "rse_mount_path": "/eos/user/rucio", "path_begins_at": 4 }] mock_config = Struct(instances=mock_instances) config = Config(mock_config) assert config.get_instance_config( 'atlas') == mock_instances[0], "Invalid instances"