File: test_uris.py

package info (click to toggle)
pygobject 3.2.2-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 4,264 kB
  • sloc: ansic: 21,686; sh: 11,449; python: 9,482; makefile: 655; xml: 23
file content (14 lines) | stat: -rw-r--r-- 619 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import unittest

from gi.repository import GLib

class TestUris(unittest.TestCase):
    def testExtractUris(self):
        uri_list_text = "# urn:isbn:0-201-08372-8\n" + \
                        "http://www.huh.org/books/foo.html\n" + \
                        "http://www.huh.org/books/foo.pdf\n" + \
                        "ftp://ftp.foo.org/books/foo.txt\n"
        uri_list = GLib.uri_list_extract_uris(uri_list_text)
        assert uri_list[0] == "http://www.huh.org/books/foo.html"
        assert uri_list[1] == "http://www.huh.org/books/foo.pdf"
        assert uri_list[2] == "ftp://ftp.foo.org/books/foo.txt"