def test_polygons_produced_are_subset_of_all_available_polygons(self): all_available_polygons = set(TriangleFactory.products()).union( QuadrilateralFactory.products()) polygons = give_me_some_polygons( [TriangleFactory, QuadrilateralFactory]) polygons_produced = set([p.__class__.__name__ for p in polygons]) self.assertTrue(polygons_produced.issubset(all_available_polygons))
def test_triangle_factory_produces_triangles(self): triangle = TriangleFactory.make_polygon() self.assertIn(triangle.__class__.__name__, TriangleFactory.products())
def test_factories_are_abstract_and_cannot_be_instantiated(self): with self.assertRaises(TypeError): TriangleFactory() with self.assertRaises(TypeError): QuadrilateralFactory()