Beispiel #1
0
    def test_uri(self):
        gio = GioURI()
        if not gio.available:
            self.skipTest(u"GIO library not found")

        self.assertEqual(gio.uri(u"/foo"), b"file:///")  # silent fail
        self.assertEqual(gio.uri(b"/foo"), b"file:///foo")
        self.assertEqual(gio.uri(b"/foo!"), b"file:///foo!")
        self.assertEqual(gio.uri(b'/music/\xec\x8b\xb8\xec\x9d\xb4'),
                         b'file:///music/%EC%8B%B8%EC%9D%B4')
Beispiel #2
0
    def test_uri(self):
        gio = GioURI()
        if not gio.available:
            self.skipTest(u"GIO library not found")

        self.assertEqual(gio.uri(u"/foo"), u"file:///")  # silent fail
        self.assertEqual(gio.uri(b"/foo"), u"file:///foo")
        self.assertEqual(gio.uri(b"/foo!"), u"file:///foo!")
        self.assertEqual(
            gio.uri(b'/music/\xec\x8b\xb8\xec\x9d\xb4'),
            u'file:///music/%EC%8B%B8%EC%9D%B4')
Beispiel #3
0
    def test_uri(self):
        gio = GioURI()
        plib = PathlibURI()
        if not gio.available:
            self.skipTest("GIO library not found")

        self.assertEqual(gio.uri("/foo"), b"file:///")  # silent fail
        self.assertEqual(gio.uri(b"/foo"), b"file:///foo")
        self.assertEqual(gio.uri(b"/foo!"), b"file:///foo!")
        self.assertEqual(plib.uri(b"/foo!"), b"file:///foo%21")
        self.assertEqual(gio.uri(b"/music/\xec\x8b\xb8\xec\x9d\xb4"), b"file:///music/%EC%8B%B8%EC%9D%B4")
        self.assertEqual(plib.uri(b"/music/\xec\x8b\xb8\xec\x9d\xb4"), b"file:///music/%EC%8B%B8%EC%9D%B4")