Repository navigation
Conversation
korydraughn
left a comment
There was a problem hiding this comment.
Does the updated test reproduce the bug reported in the issue?
| # This function duplicates the way in which the client API endpoint calculates iRODS option keywords | ||
| # for the underlying API call: | ||
| get_call_keywords = lambda metacoll: metacoll._manager._updated_keywords((),) |
There was a problem hiding this comment.
Is this saying it duplicates the key-value pairs stored in the manager?
I'm struggling to understand what this does?
There was a problem hiding this comment.
It emulates the internal calculation of api keywords given to the iRODS api, based on the input metacoll.
So for two different such objects:
get_call_keywords(Data.metadata(admin=False)) -> {}and
get_call_keywords(Data.metadata(admin=True)) -> {**ADMIN_KW:''}is what you would expect.
There was a problem hiding this comment.
It emulates the internal calculation of api keywords given to the iRODS api, based on the input metacoll.
By "iRODS api", I take it you're referring to the PRC's interface and NOT the iRODS RPC interface, correct?
So, that lambda is using code that is private to the implementation to prove correctness?
Is there no way to do this without reaching behind the public API of the library?
There was a problem hiding this comment.
We're testing what the PRC interface will be sending through the wire. I'm guessing the only other way would be to put in loggers that record the actual keywords used in a place that can be verified in a test, then call the metadata API itself to see if the keyword appears.
There was a problem hiding this comment.
The above basically says, we're testing what the client's API endpoint for metadata is doing in terms of the flags in the hand-off to the wire and thus the server. If you like, @korydraughn, I can just put in some extra comments for explanation to that effect. But I can't see anything really wrong with the approach.
There was a problem hiding this comment.
never hurts to have words explaining 'why', along with the 'what' of the code. and if the 'what' needs explanatory words too, that's fine...
Yes. if you revert the changes, the test fails on the line |
Use of ADMIN_KW carried over into subsequent metadata calls even if unwanted.