1# Copyright 2017 Christoph Reiter
2#
3# This program is free software; you can redistribute it and/or modify
4# it under the terms of the GNU General Public License as published by
5# the Free Software Foundation; either version 2 of the License, or
6# (at your option) any later version.
7
8
9from quodlibet.library import SongLibrarian
10from quodlibet.player import PlayerError
11
12try:
13    from quodlibet.player.xinebe.player import XinePlaylistPlayer
14except ImportError:
15    XinePlaylistPlayer = None
16
17from . import TestCase, skipUnless
18
19
20@skipUnless(XinePlaylistPlayer is not None, "no xinebe")
21class TXinePlaylistPlayer(TestCase):
22
23    def test_init(self):
24        try:
25            player = XinePlaylistPlayer(None, SongLibrarian())
26        except PlayerError:
27            # travis has no output
28            pass
29        else:
30            player.destroy()
31
32    def test_init_device_non_existing(self):
33        with self.assertRaises(PlayerError):
34            XinePlaylistPlayer(b"this is not a device", SongLibrarian())
35