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_player_mpv_init():
myplayer = MPVPlayer("player1 title", "player1 path", episode)
assert isinstance(myplayer, MPVPlayer)
def test_player_mpv_episode():
myplayer = MPVPlayer("player1 title", "player1 path", episode)
assert myplayer.episode == episode
def test_player_mpv_change_rate_increase():
myplayer = MPVPlayer("player1 title", "player1 path", episode)
myplayer._player = mock.MagicMock()
myplayer._player.speed = 1
myplayer.change_rate(1)
assert myplayer._player.speed == 1.1
def test_player_mpv_str():
myplayer = MPVPlayer("player1 title", "player1 path", episode)
assert str(myplayer) == "[%s] %s" % (episode.feed_str, myplayer.title)
def test_player_mpv_pause():
myplayer = MPVPlayer("player1 title", "player1 path", episode)
myplayer._player = mock.MagicMock()
myplayer.pause()
assert myplayer.state == 2
def test_player_mpv_stop():
myplayer = MPVPlayer("player1 title", "player1 path", episode)
myplayer._player = mock.MagicMock()
myplayer.stop()
assert myplayer.state == 0
def test_player_mpv_change_rate_display():
myplayer = MPVPlayer("player1 title", "player1 path", episode)
myplayer._player = mock.MagicMock()
display = mock.MagicMock()
myplayer._player.speed = 1
myplayer.change_rate(1, display=display)
assert display.change_status.call_count == 1
def test_player_mpv_check_dependencies():
assert MPVPlayer.check_dependencies
def test_player_mpv_time():
myplayer = MPVPlayer("player1 title", "player1 path", episode)
myplayer._player = mock.MagicMock()
myplayer._player.time_pos = 5
assert myplayer.time == 5000
def test_player_mpv_title():
myplayer = MPVPlayer("player1 title", "player1 path", episode)
assert myplayer.title == "player1 title"