Commit Graph

277 Commits

Author SHA1 Message Date
John Helmert 8df2df93f6 Simplify score and comment count data
This commit changes the functionality of the Content class (and its
subclasses) by removing the text from the comments and score fields of
Reddit data dictionaries created by Content.strip*.  data['comments'] is
now an integer, but data['score'] remains a string to preserve using '-'
when the score is hidden.

It is now the responsibility of wherever this data is used to provide
the extra text that these variables used to include, and modifications
have been made to the Submission and Subreddit classes to preserve the
previous way the data was displayed.

Tests modified to expect these changes.
2019-07-29 19:10:26 -05:00
John Helmert 5436dc9fce Add %u to SubredditPage._create_format test 2019-07-25 22:03:41 -05:00
John Helmert 88a75492a4 Repair failing test and fix %U bug
Fix SubredditPage._url_str parsing the wrong URL for 'external' URL
types. Make urlparse import agnostic between python2 and 3.
2019-07-25 21:23:17 -05:00
John Helmert 878a510185 Implement %u format specifier
New test function for the new SubredditPage._url_str() function added to
test_subreddit.py. Being able to see the information this specifier adds
makes it trivial to tell if a post is a Reddit crosspost from a
SubredditPage (more trivial than manually parsing a full URL from %U,
anyway).
2019-07-25 18:21:04 -05:00
John Helmert 0255c217eb Repair and test logic to avoid printing None strings 2019-07-21 15:47:18 -05:00
John Helmert add8866f73 Add test for SubredditPage._draw_item_format 2019-07-21 14:38:57 -05:00
John Helmert 3716a4d69e Increase test coverage of subreddit_page.py
Most notably, test functions for _submission_attr, _url_attr, _gold_str,
and _create_format have been added. The constructor test has been
modified into two functions that test the default view and nondefault
views.
2019-07-18 18:01:17 -05:00
John Helmert 7f1206e785 Fix failing test which requires default look_and_feel 2019-07-06 13:00:30 -05:00
John Helmert de35144214 Refactor tests/test_config.py
Give _copy_settings_file its own tests, and copy_default_*() now don't
test functionality tested by the _copy_settings_file test
2019-07-01 21:21:55 -05:00
John Helmert 491e652470 Encapsulate config constants in Config class 2019-07-01 19:10:18 -05:00
John Helmert 17a17f12d5 Fix and split clipboard tests into *nix and Darwin 2019-06-29 21:33:04 -05:00
John Helmert 9dbd0549f9 Fix tests in test_object that failed with pytest-5 2019-06-29 19:26:16 -05:00
John Helmert c5f1500ffb Fix tests for modifications made last commit
SubredditContent now has a constructor that uses a config object, this
simply fixes all the constructions of SubredditContent that caused
errors.
2019-06-29 17:02:16 -05:00
John Helmert 4f37dd1710 Add full test coverage for Content.humanize_timestamp 2019-06-12 21:00:02 -05:00
John Helmert c30e2559f7 Add test for OSX copy() to clipboard 2019-06-12 19:49:05 -05:00
John Helmert 942e651654 Update test cassette User-Agents to tuir 2019-06-09 21:00:09 -05:00
John Helmert 7e9455b4ca Rename rtv to tuir 2019-06-09 19:31:35 -05:00
John Helmert 1c0afc8a55 More adjustments for new maintainership 2019-06-09 11:05:37 -05:00
John Helmert 7423a43e50 Make the clipboard command user-configurable
Add config item clipboard_cmd, with a default of 'pbcopy w' on Darwin
and 'xclip' on everything else. This will allow the user to use any
command for the clipboard, including 'wl-copy' for Wayland (addressing
issue #693 on Github). With his change, significant simplifications
could be made to clipboard.py - the copy_*() functions have been removed
and combined into copy().

With this simplification, the old OSX test is obsolete, and new OSX
tests are needed (need a way to simulate sys.platform).
2019-06-08 15:18:15 -05:00
Michael Lazar 7a71023a40 Large commit to add support for browsing the inbox 2019-02-27 02:04:45 -05:00
Michael Lazar 3f7c9410a6 Update terminal tests 2019-02-18 21:24:11 -05:00
Michael Lazar 05297eb59b Prevent stripping newlines in the middle of markdown submissions 2019-02-13 10:10:24 -05:00
Michael Lazar c019a62a72 Removing platform dependent tests because they're hard to keep up to date and not that useful 2019-02-03 00:33:34 -05:00
Michael Lazar 8042f3e1f0 Added tests, minor refactoring 2019-02-03 00:24:38 -05:00
Michael Lazar 6796ee7415 Fix gfycat mime parser 2019-02-02 22:05:19 -05:00
Michael Lazar 465d37095a Adding test 2019-02-02 19:15:51 -05:00
Michael Lazar a727110e40 Adding test cases 2019-02-02 19:02:38 -05:00
Michael Lazar b21cb6d018 Merge pull request #616 from woorst/open_links_previous
Previous page link in open links prompt.
2018-10-23 10:34:00 -04:00
Gabriel Le Breton fe395ae2fd Increase code coverage for theme errors 2018-10-19 12:33:19 -04:00
Michael Lazar 81e90fccfb Making the user page titles a little fancier 2018-10-02 00:51:10 -04:00
Michael Lazar 510f3538da Merge branch 'user_pages' of https://github.com/woorst/rtv into woorst-user_pages 2018-10-01 23:56:06 -04:00
woorst 7d14494dcf Updated tests for more links per open link prompt 2018-10-01 20:09:47 -04:00
Michael Lazar 19f246adac Added welcome message when logging in for the first time with autologin disabled 2018-10-01 01:45:33 -04:00
Michael Lazar e4cced27eb Adding tests and some minor tweaks to structure. 2018-10-01 00:45:09 -04:00
mac1202 9add15cc9d Update test_mime_parsers.py 2018-09-25 17:52:44 +02:00
woorst c217483e86 remove obsolete cassettes 2018-09-16 15:02:13 -04:00
woorst 0d9de13b83 new and updated cassettes 2018-09-16 14:59:53 -04:00
woorst a00685e95a display gold counts on gild comments/submissions 2018-09-15 23:45:55 -04:00
woorst e6157c5e80 add test for user pages 2018-09-15 18:06:31 -04:00
Michael Lazar 61853da8e8 Fixing test 2018-08-12 21:53:05 -04:00
Sam Tebbs 4479478492 Added refresh to footer in test 2018-08-09 21:22:21 +01:00
Michael Lazar 708b436ff1 Changed the help text format when editing comments & submissions 2018-08-05 21:28:05 -04:00
Michael Lazar f0f4527981 Fixing test 2018-08-05 00:34:34 -04:00
Michael Lazar 542c660b67 Check if a post is archived before attempting to vote on it 2018-08-05 00:32:11 -04:00
Michael Lazar b164b5a6ba Fixing mime parsers (#580)
mime parser cleanup
2018-08-04 23:24:32 -04:00
Michael Lazar b8fb0cf418 Fixing tests and adding cassettes 2018-08-04 01:42:43 -04:00
Edridge D'Souza ccfff97ee6 Fixed the menu bar in the tests and commented out broken tests
Commented out any tests for the gilded method that would require an existing cassette using the gilded sort. Once we have a cassette for that, I believe we can uncomment these lines and (hopefully) have them work.
2018-07-16 18:08:35 -04:00
Edridge D'Souza 93bf150780 Trying again to fix tests 2018-07-16 17:29:30 -04:00
Edridge D'Souza 95d184bfbe Blank commit 2018-07-16 17:18:59 -04:00
Edridge D'Souza 624a0dc7c8 Added missing comma 2018-07-16 17:13:41 -04:00