def test_unpack_no_engine(unpack_kwargs): del unpack_kwargs["engine"] del unpack_kwargs["context"]["engine"] with pytest.raises(ValueError): unpack_from_dynamodb(**unpack_kwargs)
def test_unpack_obj(unpack_kwargs): del unpack_kwargs["model"] unpack_kwargs["obj"] = User() result = unpack_from_dynamodb(**unpack_kwargs) assert result.name == "numberoverzero" assert result.joined is None
def test_unpack_obj_and_model(unpack_kwargs): unpack_kwargs["obj"] = User() with pytest.raises(ValueError): unpack_from_dynamodb(**unpack_kwargs)
def test_unpack_model(unpack_kwargs): result = unpack_from_dynamodb(**unpack_kwargs) assert result.name == "numberoverzero" assert result.joined is None
def test_unpack_no_obj_or_model(unpack_kwargs): del unpack_kwargs["model"] with pytest.raises(ValueError): unpack_from_dynamodb(**unpack_kwargs)