Conversation
jason-raitz
commented
Mar 18, 2026
- removed unused client.search()
- added client.write_search_results_to_file()
- added method to iterate through search xml results
- added some xml fixtures for a first and last result for a sample search as well as the expected output xml for said search.
- removed unused client.search() - added client.write_search_results_to_file() - added method to iterate through search xml results - added some xml fixtures for a first and last result for a sample search as well as the expected output xml for said search.
- commenting out for now to use as template for new tests
|
Since the eventual goal was to migrate Willa to this as well, I don't think |
anarchivist
left a comment
There was a problem hiding this comment.
generally looks good. what else is left other than the tests?
- and some sensible guard statements - checked for some edge cases - lengthened max-line-length defaults to be a little friendlier
Questions
|
awilfox
left a comment
There was a problem hiding this comment.
Looking really good, but we should find answers to your questions before merging IMO.
There's a lot of debate in the Python community over this. PEP 8 says 79 characters. I don't think modern Python can be effectively written with a 79 character limit. PyCharm and the Google style guide use 120. I think this is too long, and indeed, with my present eyesight my font size is too large to allow 120 characters to fit on the laptop screen. I think 100 is a fair compromise and is what we used in Willa.
This would be a great discussion to have at sprint planning.
I'm firmly on the side of 0 results not being an error or an exceptional condition. |
tests/test_fetch.py
Outdated
| def test_write_search_results_to_file_with_malformed_output_filename( | ||
| client: TINDClient, | ||
| malformed_filename: str = " .csv", | ||
| ) -> None: | ||
| """write_search_results_to_file raises ValueError for a malformed output filename.""" | ||
| with pytest.raises(ValueError, match="output_file_name"): | ||
| client.write_search_results_to_file("", output_file_name = malformed_filename) |
There was a problem hiding this comment.
how are we determining a malformed filename? i don't remember this being defined in the ticket.
There was a problem hiding this comment.
it's not. just an edge case I threw in as a possibility. I could see a case where someone accidentally tries to give csv extension for the xml file.
There was a problem hiding this comment.
I'd still take this out - it feels superfluous, and I can't think of a good reason why the client should care what the filename is that it's writing to.
Co-authored-by: Anna Wilcox <[email protected]>
- reverts max-line-length preference to 100 - fixes some tests - clarifies a couple of edge cases