How to use the castero.menus.episodemenu.EpisodeMenu function in castero

To help you get started, we’ve selected a few castero examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github xgi / castero / tests / test_menu_episode.py View on Github external
def test_menu_episode_init():
    mymenu = EpisodeMenu(window, source)
    assert isinstance(mymenu, EpisodeMenu)
github xgi / castero / tests / test_menu_episode.py View on Github external
def test_menu_episode_init():
    mymenu = EpisodeMenu(window, source)
    assert isinstance(mymenu, EpisodeMenu)
github xgi / castero / tests / test_menu_episode.py View on Github external
def test_menu_episode_item():
    mymenu = EpisodeMenu(window, source)
    mymenu.update_items(feed)
    assert mymenu.item == episode1
    mymenu._selected += 1
    assert mymenu.item == episode2
github xgi / castero / tests / test_menu_episode.py View on Github external
def test_menu_episode_update_items(mock_color_pair, mock_A_NORMAL):
    mymenu = EpisodeMenu(window, source)
    mymenu.update_items(feed)
    source.episodes.assert_called_with(feed)
    assert len(mymenu._items) == 2
    assert len(mymenu) == 2
github xgi / castero / tests / test_menu_episode.py View on Github external
def test_menu_episode_invert():
    mymenu = EpisodeMenu(window, source)
    mymenu.invert()
    assert mymenu._inverted
    mymenu.update_items(feed)
github xgi / castero / tests / test_menu_episode.py View on Github external
def test_menu_episode_metadata_none():
    mymenu = EpisodeMenu(window, source)
    assert mymenu.metadata == ""
    mymenu.update_items(None)
    assert mymenu.metadata == ""
github xgi / castero / tests / test_menu_episode.py View on Github external
def test_menu_episode_metadata():
    mymenu = EpisodeMenu(window, source)
    mymenu.update_items(feed)
    assert mymenu.metadata == episode1.metadata
github xgi / castero / castero / perspectives / simpleperspective.py View on Github external
def create_menus(self) -> None:
        """Create the menus used in each window, if necessary.

        Overrides method from Perspective; see documentation in that class.
        """
        assert all(window is not None for window in [
            self._feed_window, self._episode_window
        ])

        self._episode_menu = EpisodeMenu(
            self._episode_window, self._display.database)
        self._feed_menu = FeedMenu(self._feed_window, self._display.database,
                                   child=self._episode_menu, active=True)
github xgi / castero / castero / menus / feedmenu.py View on Github external
def __init__(self, window, source, child=None, active=False) -> None:
        assert child is not None and isinstance(child, EpisodeMenu)

        self._feeds = []

        super().__init__(window, source, child=child, active=active)
github xgi / castero / castero / perspectives / primaryperspective.py View on Github external
def create_menus(self) -> None:
        """Create the menus used in each window.

        Overrides method from Perspective; see documentation in that class.
        """
        assert all(window is not None for window in [
            self._feed_window, self._episode_window
        ])

        self._episode_menu = EpisodeMenu(
            self._episode_window, self._display.database)
        self._feed_menu = FeedMenu(self._feed_window, self._display.database,
                                   child=self._episode_menu, active=True)