Beispiel #1
0
def test_get_loader_config_override():
    """Test two loaders that override the defaults."""
    configs = _get_loader_configs(TEST_CONFIG)

    # Check each config overrode the defaults.
    assert len(configs) == 2
    assert configs[0]['num_workers'] == 10
    assert configs[3]['num_workers'] == 5
    assert configs[0]['delay_queue_ms'] == 100
    assert configs[3]['delay_queue_ms'] == 0

    # Check the defaults are still there.
    assert configs[0]['force_synchronous'] is False
    assert configs[3]['force_synchronous'] is False
Beispiel #2
0
def test_get_loader_config_defaults():
    """Test config that has defaults but no octree loaders."""
    config = {
        "loader_defaults": {
            "force_synchronous": False,
            "num_workers": 10,
            "delay_queue_ms": 0,
        },
        "octree": {},
    }
    configs = _get_loader_configs(config)
    assert len(configs) == 1
    configs[0]['num_workers'] == 10
    configs[0]['delay_queue_ms'] == 10
Beispiel #3
0
def test_get_loader_config_error():
    """Test that defaults are required."""
    config = {}
    with pytest.raises(KeyError):
        _get_loader_configs(config)