How to use the castero.player.Player.create_instance 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_player.py View on Github external
def test_player_create_instance_dep_error_indirect():
    Config.data = {'player': ''}
    SomePlayer.check_dependencies.side_effect = PlayerDependencyError()
    with pytest.raises(PlayerDependencyError):
        Player.create_instance(available_players, "t", "p", episode)
        assert SomePlayer.check_dependencies.call_count == 1
github xgi / castero / tests / test_player.py View on Github external
def test_player_create_instance_dep_error_direct():
    Config.data = {'player': 'someplayer'}
    SomePlayer.check_dependencies.side_effect = PlayerDependencyError()
    with pytest.raises(PlayerDependencyError):
        Player.create_instance(available_players, "t", "p", episode)
        assert SomePlayer.check_dependencies.call_count == 1
github xgi / castero / tests / test_player.py View on Github external
def test_player_create_instance_success_indirect():
    Config.data = {'player': ''}
    Player.create_instance(available_players, "t", "p", episode)
    SomePlayer.check_dependencies.assert_called = 2
    SomePlayer.assert_called_with("t", "p", episode)
github xgi / castero / castero / display.py View on Github external
def _restore_queue(self) -> None:
        """Recreate players in queue from the database.
        """
        for episode in self.database.queue():
            player = Player.create_instance(
                self.AVAILABLE_PLAYERS, str(episode),
                episode.get_playable(), episode)
            self.queue.add(player)