def test_delattr(self): m = BaseModel(foo="bar") assert m.foo == "bar" del m.foo with pytest.raises(AttributeError): m.foo with pytest.raises(AttributeError): del BaseModel().foo
def test_response_result(self): m = BaseModel() with pytest.raises(NotImplementedError): m.response_result(None)
def test_setattr(self): m = BaseModel() m.foo = "bar" assert m.data["foo"] == "bar"
def test_getattr(self): assert BaseModel(foo="bar").foo == "bar" with pytest.raises(AttributeError): BaseModel().foo
def test_basic_init(self): m = BaseModel(a="one", B="two") assert m.data == {"A": "one", "b": "two"}