Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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)
def test_queue_init(display):
myqueue = Queue(display)
assert isinstance(myqueue, Queue)
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')
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)
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)
def test_player_mpv_init():
myplayer = MPVPlayer("player1 title", "player1 path", episode)
assert isinstance(myplayer, MPVPlayer)
def test_downloadqueue_init():
mydownloadqueue = DownloadQueue()
assert isinstance(mydownloadqueue, DownloadQueue)
def test_menu_episode_init():
mymenu = EpisodeMenu(window, source)
assert isinstance(mymenu, EpisodeMenu)
def test_menu_episode_init():
mymenu = EpisodeMenu(window, source)
assert isinstance(mymenu, EpisodeMenu)
def test_menu_queue_init():
mymenu = QueueMenu(window, source)
assert isinstance(mymenu, QueueMenu)