def test_has_model(self): from libcellml import ImportSource, Model x = ImportSource() model = Model() self.assertFalse(x.hasModel()) x.setModel(model) self.assertTrue(x.hasModel()) x.removeModel() self.assertFalse(x.hasModel())
def test_has_model(self): from libcellml import ImportSource, Model # bool hasModel() const; x = ImportSource() self.assertFalse(x.hasModel()) x.setModel(Model()) self.assertTrue(x.hasModel()) x.setModel(None) self.assertFalse(x.hasModel())
def test_model(self): from libcellml import ImportSource, Model model = Model() model.setName('bert') x = ImportSource() self.assertIsNone(x.model()) x.setModel(model) self.assertEqual(x.model().name(), model.name()) x.setModel(None) self.assertIsNone(x.model())
def test_get_model(self): from libcellml import ImportSource, Model # libcellml::ModelPtr getModel() const; model = Model() model.setName('bert') x = ImportSource() self.assertIsNone(x.getModel()) x.setModel(model) self.assertEqual(x.getModel().getName(), model.getName()) x.setModel(None) self.assertIsNone(x.getModel())
def test_set_model(self): from libcellml import ImportSource, Model # void setModel(const ModelPtr &model); x = ImportSource() x.setModel(None) x.setModel(Model()) x.setModel(None)