~ubuntu-branches/debian/wheezy/quodlibet/wheezy

« back to all changes in this revision

Viewing changes to tests/test_util.py

  • Committer: Package Import Robot
  • Author(s): Ondřej Kuzník, Ondrej Kuznik
  • Date: 2012-05-31 10:37:48 UTC
  • mfrom: (1.1.21)
  • Revision ID: package-import@ubuntu.com-20120531103748-21nuk1ybccerhqa3
Tags: 2.4-1
[ Ondrej Kuznik ]
* New upstream release 2.4
* Notable changes:
  - Queue keyboard shortcut is now Ctrl+Return instead of Q
  - Improved startup speed
  - The paned browser is now the default one
  - Tray icon appears in KDE panel again
  - Close buttons in all dialogs
  - New ~#filesize tag: requires library reload
  - Improvements for the album and radio browser
  - Better support for the language tag
  - Ogg Theora tagging support
  - xinelib 1.2 support
  - Several updated translations.
* Bump Standards-Version to 3.9.3.1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
194
194
 
195
195
        self.failUnlessEqual(self.smaller(u"bbb", u"zzz3"), True)
196
196
 
 
197
    def test_false(self):
 
198
        # album browser needs that to sort albums without artist/title
 
199
        # to the bottom
 
200
        self.failIf(util.human_sort_key(""))
 
201
 
197
202
    def test_white(self):
198
203
        self.failUnlessEqual(
199
204
            util.human_sort_key(u"  3foo    bar6 42.8"),
246
251
        map(self.failUnlessEqual, map(util.format_size, d.keys()), d.values())
247
252
 
248
253
    def test_bytes(self):
249
 
        self.t_dict({ 0: "0B", 1: "1B", 1023: "1023B" })
 
254
        self.t_dict({ 0: "0 B", 1: "1 B", 1023: "1023 B" })
250
255
 
251
256
    def test_kbytes(self):
252
 
        self.t_dict({ 1024: "1.00KB", 1536: "1.50KB",
253
 
                      10240: "10KB", 15360: "15KB" })
 
257
        self.t_dict({ 1024: "1.00 KB", 1536: "1.50 KB",
 
258
                      10240: "10 KB", 15360: "15 KB" })
254
259
 
255
260
    def test_mbytes(self):
256
 
        self.t_dict({ 1024*1024: "1.00MB", 1024*1536: "1.50MB",
257
 
                      1024*10240: "10.0MB", 1024*15360: "15.0MB",
258
 
                      123456*1024: "121MB", 765432*1024: "747MB"})
 
261
        self.t_dict({ 1024*1024: "1.00 MB", 1024*1536: "1.50 MB",
 
262
                      1024*10240: "10.0 MB", 1024*15360: "15.0 MB",
 
263
                      123456*1024: "121 MB", 765432*1024: "747 MB"})
259
264
 
260
265
    def test_gbytes(self):
261
 
        self.t_dict({ 1024*1024*1024: "1.0GB", 1024*1024*1536: "1.5GB",
262
 
                      1024*1024*10240: "10.0GB", 1024*1024*15360: "15.0GB"})
 
266
        self.t_dict({ 1024*1024*1024: "1.0 GB", 1024*1024*1536: "1.5 GB",
 
267
                      1024*1024*10240: "10.0 GB", 1024*1024*15360: "15.0 GB"})
263
268
add(Tformat_size)
264
269
 
265
270
class Tsplit_title(TestCase):
312
317
        self.failUnlessEqual(util.split_people("foo (bar)"), ("foo", ["bar"]))
313
318
    def test_with_person(self):
314
319
        self.failUnlessEqual(
315
 
            util.split_people("foo (with bar)"), ("foo", ["bar"]))
 
320
            util.split_people("foo (With bar)"), ("foo", ["bar"]))
316
321
    def test_with_with_person(self):
317
322
        self.failUnlessEqual(
318
323
            util.split_people("foo (with with bar)"), ("foo", ["with bar"]))
319
324
    def test_featuring_two_people(self):
320
325
        self.failUnlessEqual(
321
326
            util.split_people("foo featuring bar, qx"), ("foo", ["bar", "qx"]))
 
327
    def test_featuring_person_bracketed(self):
 
328
        self.failUnlessEqual(
 
329
            util.split_people("foo (Ft. bar)"), ("foo", ["bar"]))
 
330
        self.failUnlessEqual(
 
331
            util.split_people("foo(feat barman)"), ("foo", ["barman"]))
 
332
 
322
333
add(Tsplit_people)
323
334
 
324
335
class Ttag(TestCase):
390
401
                            "<i>&amp;</i>")
391
402
    def test_invalid(self):
392
403
        self.failUnlessEqual(util.pattern("<date"), "")
 
404
        util.pattern("<d\\")
 
405
 
393
406
add(Tpattern)
394
407
 
395
408
class Tformat_time_long(TestCase):