コード例 #1
0
ファイル: test_bookmark.py プロジェクト: briangershon/Bookie
    def test_getlist(self):
        """The getlist should return a list of bookmarks 
        
        and abide by the limit option
        
        """
        blist = BookmarkManager.get_list()

        self.assertEquals(len(blist), 3)

        blist2 = BookmarkManager.get_list(limit=2)
        self.assertEquals(len(blist2), 2)
コード例 #2
0
ファイル: test_bookmark.py プロジェクト: adamlincoln/Bookie
    def test_getlist(self):
        """The getlist should return a list of bookmarks 
        
        and abide by the limit option
        
        """
        blist = BookmarkManager.get_list()

        self.assertEquals(len(blist), 3)

        blist2 = BookmarkManager.get_list(limit=2)
        self.assertEquals(len(blist2), 2)
コード例 #3
0
ファイル: test_bookmark.py プロジェクト: adamlincoln/Bookie
    def test_getlist_sorting(self):
        """getlist should also accept sorting parameters


        """
        blist = BookmarkManager.get_list(order_by=Bookmark.url, order=model.ORDER_DESC)
        self.assertEquals(blist[0].url, 'http://yahoo.com')

        blist = BookmarkManager.get_list(order_by=Bookmark.url)
        self.assertEquals(blist[0].url, 'http://cnn.com')

        blist = BookmarkManager.get_list(order_by=Bookmark.added)
        self.assertEquals(blist[0].url, 'http://google.com')
コード例 #4
0
ファイル: test_bookmark.py プロジェクト: briangershon/Bookie
    def test_getlist_sorting(self):
        """getlist should also accept sorting parameters


        """
        blist = BookmarkManager.get_list(order_by=Bookmark.url,
                                         order=model.ORDER_DESC)
        self.assertEquals(blist[0].url, 'http://yahoo.com')

        blist = BookmarkManager.get_list(order_by=Bookmark.url)
        self.assertEquals(blist[0].url, 'http://cnn.com')

        blist = BookmarkManager.get_list(order_by=Bookmark.added)
        self.assertEquals(blist[0].url, 'http://google.com')
コード例 #5
0
ファイル: test_bookmark.py プロジェクト: briangershon/Bookie
    def test_tied_list_tags(self):
        """Test that we can get the bookmarks with the tags data"""

        blist = BookmarkManager.get_list(with_tags=True)

        for b in blist:
            self.assertTrue(len(b.tags) > 0)
コード例 #6
0
ファイル: test_bookmark.py プロジェクト: adamlincoln/Bookie
    def test_tied_list_tags(self):
        """Test that we can get the bookmarks with the tags data"""

        blist = BookmarkManager.get_list(with_tags=True)

        for b in blist:
            self.assertTrue(len(b.tags) > 0)