Fixes #1035 - Unified code for version string#1504
Fixes #1035 - Unified code for version string#1504miketaylr merged 2 commits intowebcompat:masterfrom
Conversation
miketaylr
left a comment
There was a problem hiding this comment.
Looks good! Just a few naming/comment issues, then should be good to merge. 👍
| session['avatar_url'] = gh_user.get('avatar_url') | ||
|
|
||
|
|
||
| def version_string(json_section): |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
|
|
||
|
|
||
| def version_string(json_section): | ||
| '''Gives version string out of section with `major`, `minor`, and `patch`.''' |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
| self.assertEqual(get_browser(True), 'Unknown') | ||
| self.assertEqual(get_browser(False), 'Unknown') | ||
| self.assertEqual(get_browser(None), 'Unknown') | ||
| self.assertEqual(get_browser_name('<script>lol()</script>'), 'unknown') |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
|
@moraveyo I'm not sure if this is ready for re-review yet, can you ping when it is? Thanks! (no rush, just want to make sure I'm not ignoring your work.) |
|
r? @miketaylr |
You could use some of the bogus stuff in these tests: https://github.com/moraveyo/webcompat.com/blob/eadb82be50b3e6d8e7095c57959725b467b0114e/tests/test_helpers.py#L145-L151, or you could invent something wacky like "Nozilla/1.0 (TI-83 Graphing Calculator;) CoolBrowser/1.0" |
|
@moraveyo can you run pep8 on your changes? There's a few style nits here -- thanks! |
|
Oops... I first tried |
|
r? @miketaylr |
|
LGTM! We just need to clean up the git history. Maybe 3 commits: 1 for the unified code refactor, one for the new tests, and one for fixing the existing tests? LMK if you get stuck on that! |
|
r? @miketaylr |
|
Looks like I did the mess with rebase |
|
r? @miketaylr |
|
Awesome, thanks! And yeah, splitting git commits is not fun (or easy...). This looks great, thanks for all your work here. |
|
(there were some pep8 errors, but I pushed a fixup commit here: e02eccb) |
|
Strange, I've already removed some spaces so that |
|
I first even tried |
|
Hmm, odd that we saw different things. In general, python style doesn't like whitespace for alignment. See https://www.python.org/dev/peps/pep-0008/#whitespace-in-expressions-and-statements (look for "More than one space around an assignment (or other) operator to align it with another. ") |
r? @miketaylr