Edgewall Software

Changes between Version 1 and Version 2 of Ticket #12211, comment 30


Ignore:
Timestamp:
Jun 14, 2018, 6:59:12 AM (6 years ago)
Author:
Ryan J Ollos

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #12211, comment 30

    v1 v2  
    1 If I was implementing `MockRequest` now, I would have add a property `response_sent` that returned the value from the buffer, to avoid accessing as `req.response_sent.getvalue()`. See for example what is done here: [browser:trunk/trac/web/tests/api.py@16656:106-108#L88]. However, `Request.response_sent` is an attribute and changing it to a property would be an API change.
     1If I was implementing `MockRequest` now, I would add a property `response_sent` that returned the value from the buffer, to avoid accessing as `req.response_sent.getvalue()`. See, for example, what is done here: [browser:trunk/trac/web/tests/api.py@16656:106-108#L88]. However, `Request.response_sent` is an attribute and changing it to a property would be an API change.
    22
    3 I suppose we could added an accessor such as `get_response()`, but I tend to think it confuses more than helps to have multiple public attributes and functions for accessing the same data.
     3I suppose we could add an accessor such as `get_response_sent()`, but I tend to think it is confusing to developers when we have multiple public attributes and functions for accessing the same data.