How to use castero - 10 common examples

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_episode.py View on Github external
def test_episode_init():
    myfeed = Feed(file=my_dir + "/feeds/valid_basic.xml")
    myepisode = Episode(myfeed,
                        title=title,
                        description=description,
                        link=link,
                        pubdate=pubdate,
                        copyright=copyright,
                        enclosure=enclosure)
    assert isinstance(myepisode, Episode)
github xgi / castero / tests / test_queue.py View on Github external
def test_queue_init(display):
    myqueue = Queue(display)
    assert isinstance(myqueue, Queue)
github xgi / castero / tests / test_menu_queue.py View on Github external
from unittest import mock

from castero.episode import Episode
from castero.player import Player
from castero.queue import Queue
from castero.feed import Feed
from castero.menus.queuemenu import QueueMenu

feed = mock.MagicMock(spec=Feed)
player1 = mock.MagicMock(spec=Player)
player2 = mock.MagicMock(spec=Player)
player1.episode = mock.MagicMock(spec=Episode)
window = mock.MagicMock()
window.getmaxyx = mock.MagicMock(return_value=(40, 80))
source = mock.MagicMock(spec=Queue)
source.__iter__.return_value = [player1, player2]
source.__getitem__.return_value = player1


def test_menu_queue_init():
    mymenu = QueueMenu(window, source)
    assert isinstance(mymenu, QueueMenu)


def test_menu_queue_update_items():
    mymenu = QueueMenu(window, source)
    mymenu.update_items(None)
    assert len(mymenu._items) == 2


@mock.patch('curses.A_NORMAL')
github xgi / castero / tests / test_menu_queue.py View on Github external
from unittest import mock

from castero.episode import Episode
from castero.player import Player
from castero.queue import Queue
from castero.feed import Feed
from castero.menus.queuemenu import QueueMenu

feed = mock.MagicMock(spec=Feed)
player1 = mock.MagicMock(spec=Player)
player2 = mock.MagicMock(spec=Player)
player1.episode = mock.MagicMock(spec=Episode)
window = mock.MagicMock()
window.getmaxyx = mock.MagicMock(return_value=(40, 80))
source = mock.MagicMock(spec=Queue)
source.__iter__.return_value = [player1, player2]
source.__getitem__.return_value = player1


def test_menu_queue_init():
    mymenu = QueueMenu(window, source)
    assert isinstance(mymenu, QueueMenu)


def test_menu_queue_update_items():
    mymenu = QueueMenu(window, source)
github xgi / castero / tests / test_menu_queue.py View on Github external
from unittest import mock

from castero.episode import Episode
from castero.player import Player
from castero.queue import Queue
from castero.feed import Feed
from castero.menus.queuemenu import QueueMenu

feed = mock.MagicMock(spec=Feed)
player1 = mock.MagicMock(spec=Player)
player2 = mock.MagicMock(spec=Player)
player1.episode = mock.MagicMock(spec=Episode)
window = mock.MagicMock()
window.getmaxyx = mock.MagicMock(return_value=(40, 80))
source = mock.MagicMock(spec=Queue)
source.__iter__.return_value = [player1, player2]
source.__getitem__.return_value = player1


def test_menu_queue_init():
    mymenu = QueueMenu(window, source)
    assert isinstance(mymenu, QueueMenu)


def test_menu_queue_update_items():
    mymenu = QueueMenu(window, source)
    mymenu.update_items(None)
github xgi / castero / tests / test_player_mpvplayer.py View on Github external
def test_player_mpv_init():
    myplayer = MPVPlayer("player1 title", "player1 path", episode)
    assert isinstance(myplayer, MPVPlayer)
github xgi / castero / tests / test_downloadqueue.py View on Github external
def test_downloadqueue_init():
    mydownloadqueue = DownloadQueue()
    assert isinstance(mydownloadqueue, DownloadQueue)
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_queue.py View on Github external
def test_menu_queue_init():
    mymenu = QueueMenu(window, source)
    assert isinstance(mymenu, QueueMenu)