def test_display_nonempty(self): """ Test Display of non-empty model. """ model = Model() model.object_types.add(ObjectType(name="O1")) model.fact_types.add(FactType(name="F1")) model.fact_types.add(FactType(name="F2")) model.constraints.add(Constraint(name="C1")) model.display() output = sys.stdout.getvalue().strip() self.assertEqual(output, "Object Types:\n O1\nFact Types:\n F1\n F2\nConstraints:\n C1")
def test_display_empty(self): """ Test Display of an empty model. """ model = Model() model.display() output = sys.stdout.getvalue().strip() self.assertEqual(output, "Object Types:\nFact Types:\nConstraints:")