def create_model(self): """Create a Model object.""" unit_name = 'myapp/0' patcher = patch.dict(os.environ, {'JUJU_UNIT_NAME': unit_name}) patcher.start() self.addCleanup(patcher.stop) backend = _ModelBackend() meta = CharmMeta() model = Model('myapp/0', meta, backend) return model
def create_framework(self): model = Model(self.meta, _ModelBackend('local/0')) framework = Framework(self.tmpdir / "framework.data", self.tmpdir, self.meta, model) self.addCleanup(framework.close) return framework
def create_model(self): """Create a Model object.""" backend = _ModelBackend(unit_name='myapp/0') meta = CharmMeta() model = Model(meta, backend) return model
def create_framework(self): model = Model(self.meta, _ModelBackend('local/0')) framework = Framework(SQLiteStorage(':memory:'), self.tmpdir, self.meta, model) self.addCleanup(framework.close) return framework