def test_allocation():
    with helpers.set_single_system(True):
        result = helpers.parse_output('initial-install-config')
        nrc = NonRunningCommandRunner()
        overlay = gui.ControllerOverlay(None, nrc)
        class FakeStartKVM:
            def run(self):
                pass

        with mock.patch('cloudinstall.pegasus.StartKVM', FakeStartKVM):
            overlay.process(result)

        # we expect all the charms and relations to be added here
        assert len(nrc.to_run) == 14
def test_parse_pending_lxcs():
    with helpers.set_single_system(True):
        result = helpers.parse_output('pending')
        assert len(result) == 7