New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
3757 : Refactored test_introducer in web tests #1100
3757 : Refactored test_introducer in web tests #1100
Conversation
…se test cases Signed-off-by: fenn-cs <fenn25.fn@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I left some commentary inline. This looks like a good start.
Signed-off-by: fenn-cs <fenn25.fn@gmail.com>
b169868
to
7ad3fa9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking really good!
I'm not asking for changes here, but especially for shorter tests like this one I think we (or at least "I") have been indenting things like this:
self.assertThat(
render(resource, {b"t": [b"json"]}),
succeeded(
AfterPreprocessing(
json.loads,
Equals({
u"subscription_summary": {"arbitrary": 2},
u"announcement_summary": {"arbitrary": 1},
})
)
)
)
I'm actually curious if you think that counts as "readable", or if it's just because I'm now used to it ;)
If nothing else, I do like:
self.assertThat(
<something>,
CollectionOfMatchers(),
)
...to separate the "test thing" (<something>
) from the "expected results part" (i.e. all the testtools matchers). I do think it took me a while to get around the "matcher" style of test-tools, but it can be fairly readable (even if the writing can be a little harder, due to having to look up matchers).
p.s. I know I said "approve" but maybe @exarkun wishes to followup .. and CI has to be green before we merge things...
@meejah Yeah, I think that's more readable. I ran the linting I found the EDIT : It's worth noting that I think the use of |
Signed-off-by: fenn-cs <fenn25.fn@gmail.com>
Signed-off-by: fenn-cs <fenn25.fn@gmail.com>
…efactor.web-test-introducer
@exarkun could you approve requested changes and merge when ready please? |
Refactored
test_introducer.py
intest/web
module to either userSyncTestCase
orAsyncTestCase
.Ticket : https://tahoe-lafs.org/trac/tahoe-lafs/ticket/3757