示例#1
0
    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
    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
    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
    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
    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
    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)