Пример #1
0
class BookmarkListPresenterTest(TestCase):

    """
    Presenter for a bookmarks.

    """

    def setUp(self):
        self.bookmarks = bookmark.loader.find(join(dirname(__file__), "fixtures", "bookmarks"))

        self.presenter = BookmarkListPresenter(self.bookmarks)

    def test_ordered_by_name(self):
        """
        Bookmarks are ordered alphabetically.
        """
        self.assertEqual(["Apples", "Bananas", "Cars"], [i.title for i in self.presenter.to_list()])

    def test_by_category(self):
        categories = self.presenter.by_category()

        for category in categories:
            self.assertIsInstance(category, bookmark.Category)
Пример #2
0
    def setUp(self):
        self.bookmarks = bookmark.loader.find(join(dirname(__file__), "fixtures", "bookmarks"))

        self.presenter = BookmarkListPresenter(self.bookmarks)