def setUp(self): self.success = False # Testing locally is VERY dangerous without this... self.assertTrue(_TEMP_DIR in PLAYLISTS or os.name == "nt", msg="Failing, don't want to delete %s" % PLAYLISTS) try: shutil.rmtree(PLAYLISTS) except OSError: pass mkdir(PLAYLISTS) init_fake_app() self.lib = quodlibet.browsers.playlists.library = SongFileLibrary() self.lib.librarian = SongLibrarian() all_songs = SONGS + [self.ANOTHER_SONG] for af in all_songs: af.sanitize() self.lib.add(all_songs) self.big = pl = FileBackedPlaylist.new(PLAYLISTS, "Big", self.lib) pl.extend(SONGS) pl.write() self.small = pl = FileBackedPlaylist.new(PLAYLISTS, "Small", self.lib) pl.extend([self.ANOTHER_SONG]) pl.write() PlaylistsBrowser.init(self.lib) self.bar = PlaylistsBrowser(self.lib) self.bar.connect('songs-selected', self._expected) self.bar._select_playlist(self.bar.playlists()[0]) self.expected = None
def setUp(self): config.init() init_fake_app() fd, self.fn = mkstemp() os.close(fd) pb = GdkPixbuf.Pixbuf.new(GdkPixbuf.Colorspace.RGB, True, 8, 150, 10) pb.savev(self.fn, "png", [], [])
def setUp(self): config.init() init_fake_app() self.library = library = SongFileLibrary() library.librarian = SongLibrarian() library.add(SONGS) self.Kind.init(library) self.b = self.Kind(library)
def setUp(self): module = self.modules["CustomCommands"] globals().update(vars(module)) self.plugin = self.plugins["CustomCommands"].cls config.init() self.cmd_list = CustomCommands.DEFAULT_COMS self.commands = JSONObjectDict.from_list(self.cmd_list) init_fake_app()
def setUp(self): config.init() init_fake_app() app.player.paused = False # Only album browsers are supported currently app.library.clear() app.window.browser = AlbumList(app.library) self.plugin = self.plugins["Random Album Playback"].cls() self.albums = [A1, A2, A3]
def setUp(self): config.init() init_fake_app() self.changed = [] self.songs = [a_dummy_song()] self.Plugin = self.plugins["ImportMeta"].cls self.plugin = self.Plugin(self.songs) app.library.add(self.songs) self.sig = app.library.connect("changed", self.on_song_changed)
def setUp(self): # Need the playlists library now init_fake_app() config.RATINGS = config.HardCodedRatingsPrefs() fd, filename = mkstemp() os.close(fd) self.quux = AudioFile({ "~filename": normalize_path(filename, True), "album": u"Quuxly" })
def setUp(self): init_fake_app() config.set("library", "watch", True) super().setUp() # Replace global one with this one librarian = app.library.librarian app.library.destroy() self.library.librarian = librarian app.library = self.library self.library.filename = "watching" librarian.register(self.library, "main") assert self.library.librarian.libraries
def setUp(self): self.success = False # Testing locally is VERY dangerous without this... self.assertTrue(_TEMP_DIR in _DEFAULT_PLAYLIST_DIR or os.name == "nt", msg="Failing, don't want to delete %s" % _DEFAULT_PLAYLIST_DIR) try: shutil.rmtree(_DEFAULT_PLAYLIST_DIR) except OSError: pass mkdir(_DEFAULT_PLAYLIST_DIR) init_fake_app() self.lib = quodlibet.browsers.playlists.library = SongFileLibrary() self.lib.librarian = SongLibrarian() for af in self.ALL_SONGS: af.sanitize() self.lib.add(self.ALL_SONGS) self.big = pl = FileBackedPlaylist.new(_DEFAULT_PLAYLIST_DIR, "Big", self.lib, self.lib.playlists) pl.extend(SONGS) pl.write() self.small = pl = XSPFBackedPlaylist.new(_DEFAULT_PLAYLIST_DIR, "Small", self.lib, self.lib.playlists) pl.extend([self.ANOTHER_SONG]) pl.write() PlaylistsBrowser.init(self.lib) self.bar = PlaylistsBrowser(self.lib, self.MockConfirmerAccepting) self.bar.connect('songs-selected', self._expected) self.bar._select_playlist(self.bar.playlists()[0]) self.expected = None # Uses the declining confirmer. self.bar_decline = PlaylistsBrowser(self.lib, self.MockConfirmerDeclining) self.bar_decline.connect('songs-selected', self._expected_decline) self.bar_decline._select_playlist(self.bar_decline.playlists()[0]) # Note that _do() uses self.expected, but _do() is not called by the # testcase for declining the prompt. Tests fail with a shared expected. self.expected_decline = None
def setUp(self): quodlibet.config.init() init_fake_app() self.inf = None self.library = SongLibrary()
def setUp(self): init_fake_app() fd, self.filename = mkstemp() os.close(fd) self.info = SongInfo(SongLibrary(), NullPlayer(), self.filename)
def setUp(self): init_fake_app() quodlibet.config.init()
def setUp(self): config.init() init_fake_app()
def setUpClass(cls): config.init() init_fake_app()
def setUp(self): config.init() init_fake_app() # Avoid warnings when running with empty config set_columns(["artist", "title"]) self.win = PreferencesWindow(None)
def setUp(self): init_fake_app() self._turn_all_options_on() app.library.songs = [self.song, self.song2, self.song] self.plugin = self.kind([self.song], None)
def setUp(self): init_fake_app()
def setUp(self): self.mod = self.modules['View Lyrics'] init_fake_app() self.plugin = self.mod.ViewLyrics() self.plugin.enabled()
def setUp(self): init_fake_app() # Ugh TaskController.default_instance = TaskController() config.init()