def setUpClass(cls): config.init() browsers.init() library.init() player.init("nullbe") app.player = player.init_device(library.librarian) app.window = QuodLibetWindow(library.library, player.playlist) app.librarian = library.librarian app.player = player.playlist cls.plugin = cls.plugins["mpris"]
def setUp(self): config.init() config.set("player", "gst_pipeline", "fakesink") module = player.init(self.NAME) lib = library.init() self.player = module.init(lib.librarian) source = PlaylistModel() source.set(FILES) self.events = [] def start_end_handler(player, song, *args): self.events.append((args[-1], song)) self.player.connect("song-started", start_end_handler, "started") self.player.connect("song-ended", start_end_handler, "ended") self.player.setup(source, None, 0) self.signals = [] def handler(type_, *args): self.signals.append(type_) connect_obj(self.player, "unpaused", handler, "unpaused") connect_obj(self.player, "paused", handler, "paused")
def setUp(self): config.init() config.set("player", "gst_pipeline", "fakesink") module = player.init(self.NAME) lib = library.init() self.player = module.init(lib.librarian) source = PlaylistModel() source.set(FILES) self.events = [] def start_end_handler(player, song, *args): self.events.append((args[-1], song)) self.player.connect("song-started", start_end_handler, "started") self.player.connect("song-ended", start_end_handler, "ended") self.player.setup(source, None, 0) self.signals = {} def handler(type_, *args): self.signals.setdefault(type_, []).append(args) connect_obj(self.player, "unpaused", handler, "unpaused") connect_obj(self.player, "paused", handler, "paused")
def setUp(self): config.init() config.set("player", "gst_pipeline", "fakesink") module = player.init(self.NAME) lib = library.init() self.player = module.init(lib.librarian) source = PlaylistModel() source.set(FILES) self.player.setup(source, None, 0)
def setUpClass(cls): config.init() browsers.init() backend = player.init("nullbe") app.library = library.init() app.player = backend.init(app.librarian) app.window = QuodLibetWindow(app.library, app.player, headless=True) cls.plugin = cls.plugins["mpris"].cls
def setUp(self): self.tempdir = mkdtemp() self.pm = PluginManager(folders=[self.tempdir]) self.lib = SongLibrarian() self.player = player.init("nullbe").init(self.lib) self.handler = EventPluginHandler(librarian=self.lib, player=self.player) self.pm.register_handler(self.handler) self.pm.rescan() self.assertEquals(self.pm.plugins, [])
def setUp(self): self.tempdir = mkdtemp() self.pm = PluginManager(folders=[self.tempdir]) self.lib = SongLibrarian() self.player = player.init("nullbe").init(self.lib) self.handler = EventPluginHandler( librarian=self.lib, player=self.player) self.pm.register_handler(self.handler) self.pm.rescan() self.assertEquals(self.pm.plugins, [])
def test_window(self): lib = library.init() pl = player.init("nullbe").init(lib.librarian) window = QuodLibetWindow(lib, pl, headless=True) window.destroy()
def test_stop(self): self.player.next() self.player.seek(10000) self.assertEqual(self.player.get_position(), 10000) self.player.stop() self.assertEqual(self.player.get_position(), 0) def test_can_play_uri_xine(self): self.assertFalse(self.player.can_play_uri("")) self.assertFalse(self.player.can_play_uri("file://")) self.assertFalse(self.player.can_play_uri("fake://")) has_xine = True try: player.init("xinebe") except player.PlayerError: has_xine = False @skipUnless(has_xine, "couldn't load/test xinebe") class TXinePlayer(TPlayer): NAME = "xinebe" def test_can_play_uri_xine(self): self.assertFalse(self.player.can_play_uri("")) self.assertTrue(self.player.can_play_uri("file://")) self.assertFalse(self.player.can_play_uri("fake://")) has_gstbe = True
def test_stop(self): self.player.next() self.player.seek(10000) self.assertEqual(self.player.get_position(), 10000) self.player.stop() self.assertEqual(self.player.get_position(), 0) def test_can_play_uri_xine(self): self.assertFalse(self.player.can_play_uri("")) self.assertFalse(self.player.can_play_uri("file://")) self.assertFalse(self.player.can_play_uri("fake://")) has_xine = True try: player.init("xinebe") except player.PlayerError: has_xine = False @skipUnless(has_xine, "couldn't load/test xinebe") class TXinePlayer(TPlayer): NAME = "xinebe" def test_can_play_uri_xine(self): self.assertFalse(self.player.can_play_uri("")) self.assertTrue(self.player.can_play_uri("file://")) self.assertFalse(self.player.can_play_uri("fake://")) has_gstbe = True