diff options
author | Cédric Bonhomme <kimble.mandel+bitbucket@gmail.com> | 2015-05-15 07:24:18 +0200 |
---|---|---|
committer | Cédric Bonhomme <kimble.mandel+bitbucket@gmail.com> | 2015-05-15 07:24:18 +0200 |
commit | dd059ad8a7d94ea6d03639e10e4d41c95dd1cebd (patch) | |
tree | 8aa3c0bf481a67717987af0710540668d3467ab0 /tests/controllers/feed.py | |
parent | The list of inactive feeds is now sorted. (diff) | |
parent | testing special controller methods (diff) | |
download | newspipe-dd059ad8a7d94ea6d03639e10e4d41c95dd1cebd.tar.gz newspipe-dd059ad8a7d94ea6d03639e10e4d41c95dd1cebd.tar.bz2 newspipe-dd059ad8a7d94ea6d03639e10e4d41c95dd1cebd.zip |
Merged in jaesivsm/pyaggr3g470r (pull request #13)
introducing unittests !
Diffstat (limited to 'tests/controllers/feed.py')
-rw-r--r-- | tests/controllers/feed.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/controllers/feed.py b/tests/controllers/feed.py new file mode 100644 index 00000000..924b8ddd --- /dev/null +++ b/tests/controllers/feed.py @@ -0,0 +1,25 @@ +from tests.base import BasePyaggTest +from pyaggr3g470r.controllers import FeedController +from pyaggr3g470r.controllers import ArticleController + + +class FeedControllerTest(BasePyaggTest): + _contr_cls = FeedController + + def test_controller(self): + feed = FeedController(2).read()[0].dump() + self.assertTrue(3, + ArticleController().read(feed_id=feed['id']).count()) + self._test_controller_rights(feed, feed['user_id']) + # checking articles are deleted after the feed has been deleted + self.assertFalse(0, + ArticleController().read(feed_id=feed['id']).count()) + + self.assertEquals(3, len(FeedController(3).list_fetchable())) + self.assertEquals(0, len(FeedController(3).list_fetchable())) + self.assertEquals(2, len(FeedController().list_fetchable())) + self.assertEquals(0, len(FeedController().list_fetchable())) + self.assertEquals(3, + len(FeedController(3).list_fetchable(refresh_rate=0))) + self.assertEquals(5, + len(FeedController().list_fetchable(refresh_rate=0))) |