Пример #1
0
 def setUp(self):
     config.RATINGS = config.HardCodedRatingsPrefs()
     fd, filename = mkstemp()
     os.close(fd)
     self.quux = AudioFile({
         "~filename": normalize_path(filename, True),
         "album": u"Quuxly"
     })
Пример #2
0
 def setUp(self):
     config.RATINGS = config.HardCodedRatingsPrefs()
     self.failUnlessEqual(config.RATINGS.number, NUM_RATINGS)
     self.library = SongLibrary()
     self.library.librarian = SongLibrarian()
     self.af = AudioFile({"~filename": fsnative(u"/foo"), "~#rating": 1.0})
     self.af.sanitize()
     self.rmi = RatingsMenuItem([self.af], self.library)
Пример #3
0
 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"
     })
Пример #4
0
# -*- coding: utf-8 -*-
import shutil
import os
from quodlibet import config

from tests import TestCase, mkdtemp
from quodlibet.formats import AudioFile as Fakesong
from quodlibet.formats._audio import INTERN_NUM_DEFAULT, PEOPLE
from quodlibet.util.collection import Album, Playlist, avg, bayesian_average, \
    FileBackedPlaylist
from quodlibet.library.libraries import FileLibrary
from quodlibet.util import format_rating
from quodlibet.util.path import fsnative

config.RATINGS = config.HardCodedRatingsPrefs()

NUMERIC_SONGS = [
    Fakesong({
        "~filename": fsnative(u"fake1-\xf0.mp3"),
        "~#length": 4,
        "~#added": 5,
        "~#lastplayed": 1,
        "~#bitrate": 200,
        "date": "100",
        "~#rating": 0.1,
        "originaldate": "2004-01-01",
        "~#filesize": 101
    }),
    Fakesong({
        "~filename": fsnative(u"fake2.mp3"),
        "~#length": 7,
Пример #5
0
 def setUpClass(cls):
     config.RATINGS = config.HardCodedRatingsPrefs()
Пример #6
0
 def setUp(self):
     config.RATINGS = config.HardCodedRatingsPrefs()
     open(quux["~filename"], "w").close()