from tests.helpers.boring_model import BoringModel class TestBoringModel: def test_attributes(self): model = BoringModel() assert model.attr1 is None assert model.attr2 == "default value"
from tests.helpers.boring_model import BoringModel def create_model(attr1=None, attr2=None): model = BoringModel() model.attr1 = attr1 model.attr2 = attr2 return model def test_create_model(): model = create_model("hello", "world") assert model.attr1 == "hello" assert model.attr2 == "world"This example shows how the BoringModel class can be used to create a simple data structure that can be customized with user-provided values. The `create_model` function takes two optional arguments that can be used to override the default attribute values, and returns a new BoringModel object with those values. Overall, the BoringModel class is a useful tool for creating simple model objects that can be used for testing purposes. Its main advantage is that it provides a consistent and predictable structure for testing without requiring a lot of setup code.