API based add to allow list script (marshmallow)#224
Conversation
|
It's been requested to write this again using tl;dr
About structure (advantage
|
|
Some more speculative/personal taste things. All of these comments assume someone who is fluent with both libraries Ergonomics
Getting help
Not making a mess
Other
|
4767403 to
cd229bd
Compare
d277153 to
5a5faa6
Compare
|
I've got this most of the way, but something very weird has happened to the requirements. I'm not sure what the state of play with that is at the moment, so I'll pick this up tomorrow. |
d97953f to
2ab03a7
Compare
seanh
left a comment
There was a problem hiding this comment.
Looks good. I had to make a couple of fixes to get it to work locally, and it looks like there's a couple of unrelated changes mixed in
| # Check it notices if we change one char | ||
| last_char = "f" if nonce[:-1] != "f" else "e" | ||
| assert not service.check_nonce(nonce[:-1] + last_char) | ||
| assert not service.check_nonce(nonce[:-2] + last_char) |
There was a problem hiding this comment.
I'm trying to fix a flakey test, but I've just realised I've fixed it wrong. Looking at this the actual error is:
last_char = "f" if nonce[-1] != "f" else "e"
We need to modify part of the hash to see if it detects a change, so we try and swap the last char to an f, but 1 in 16 times it'll already be an f so we have to pick something else. This was in a separate commit with a message, but it's clearly still wrong.
It works now, but for the wrong reasons.
| _TEST_DATABASE_URL = os.environ.get( | ||
| "TEST_DATABASE_URL", | ||
| "postgresql://postgres@localhost:5434/checkmate_test", | ||
| ) |
There was a problem hiding this comment.
This is about it's use below. In one case we read from the environ only, in the other we have a default. I'm not sure when this happened, but it makes it more awkward to run individual tests in the IDE.
Added as a separate commit for the explanation.
This was attempting to make sure the last char wasn't "f", but actually compared everything apart from the last char. Previously this test would fail 1 in 16 times.
5a58825 to
74fb215
Compare
For: #195
Alternative to: #223 based on
marshmallow. The review and tests notes on that ticket pretty much still apply here.