def test_make_ready_empty(minimal_global_cfg, minimal_dc): lyr = OWSFolder( { "title": "The Title", "abstract": "The Abstract", "layers": [] }, global_cfg=minimal_global_cfg) lyr.make_ready(minimal_dc) assert len(lyr.unready_layers) == 0 assert lyr.ready
def test_make_ready_catch_errors(minimal_global_cfg, minimal_dc): lyr = OWSFolder( { "title": "The Title", "abstract": "The Abstract", "layers": [] }, global_cfg=minimal_global_cfg) testchild = MagicMock() testchild.make_ready.side_effect = ConfigException("KerPow!") lyr.unready_layers.append(testchild) lyr.make_ready(minimal_dc) assert len(lyr.unready_layers) == 1 assert len(lyr.child_layers) == 0 assert lyr.ready