コード例 #1
0
 def test_main(self):
     self.assertEqual(decode_value("~#foo", 0.25), u"0.25")
     self.assertEqual(decode_value("~#foo", 4), u"4")
     self.assertEqual(decode_value("~#foo", "bar"), u"bar")
     self.assertTrue(isinstance(decode_value("~#foo", "bar"), unicode))
     path = fsnative(u"/foobar")
     self.assertEqual(decode_value("~filename", path), fsdecode(path))
コード例 #2
0
 def test_main(self):
     self.assertEqual(decode_value("~#foo", 0.25), u"0.25")
     self.assertEqual(decode_value("~#foo", 4), u"4")
     self.assertEqual(decode_value("~#foo", "bar"), u"bar")
     self.assertTrue(isinstance(decode_value("~#foo", "bar"), str))
     path = fsnative(u"/foobar")
     self.assertEqual(decode_value("~filename", path), fsn2text(path))
コード例 #3
0
    def test_path(self):
        try:
            path = bytes2fsn(b"\xff\xff", "utf-8")
        except ValueError:
            return

        assert decode_value("~filename", path) == fsn2text(path)
コード例 #4
0
    def test_path(self):
        try:
            path = bytes2fsn(b"\xff\xff", "utf-8")
        except ValueError:
            return

        assert decode_value("~filename", path) == fsn2text(path)
コード例 #5
0
ファイル: dbus_.py プロジェクト: mikechen66/QuodLibet
 def __dict(song):
     dict = {}
     for key, value in (song or {}).items():
         value = decode_value(key, value)
         dict[key] = dbusutils.dbus_unicode_validate(value)
     if song:
         dict["~uri"] = song("~uri")
     return dict
コード例 #6
0
ファイル: dbus_.py プロジェクト: ZDBioHazard/quodlibet
 def __dict(self, song):
     dict = {}
     for key, value in (song or {}).items():
         value = decode_value(key, value)
         dict[key] = dbusutils.dbus_unicode_validate(value)
     if song:
         dict["~uri"] = song("~uri")
     return dict