예제 #1
0
 def test_parse_params_timeout(self):
     parsed = opener.parse("ftp://ftp.example.org?timeout=30")
     expected = ParseResult("ftp", None, None, "ftp.example.org",
                            {"timeout": "30"}, None)
     self.assertEqual(expected, parsed)
예제 #2
0
 def test_parse_user_password_decode(self):
     parsed = opener.parse("ftp://user%40large:[email protected]")
     expected = ParseResult("ftp", "user@large", "password",
                            "ftp.example.org", {}, None)
     self.assertEqual(expected, parsed)
예제 #3
0
 def test_parse_path(self):
     parsed = opener.parse("osfs://foo/bar!example.txt")
     expected = ParseResult("osfs", None, None, "foo/bar", {},
                            "example.txt")
     self.assertEqual(expected, parsed)
예제 #4
0
 def test_parse_params(self):
     parsed = opener.parse("ftp://ftp.example.org?proxy=ftp.proxy.org")
     expected = ParseResult("ftp", None, None, "ftp.example.org",
                            {"proxy": "ftp.proxy.org"}, None)
     self.assertEqual(expected, parsed)
예제 #5
0
 def test_parse_not_url(self):
     with self.assertRaises(errors.ParseError):
         parsed = opener.parse("foo/bar")
예제 #6
0
 def test_parse_simple(self):
     parsed = opener.parse("osfs://foo/bar")
     expected = ParseResult("osfs", None, None, "foo/bar", {}, None)
     self.assertEqual(expected, parsed)
예제 #7
0
 def test_parse_simple(self):
     parsed = opener.parse('osfs://foo/bar')
     expected = opener.registry.ParseResult('osfs', None, None, 'foo/bar',
                                            None)
     self.assertEqual(expected, parsed)
예제 #8
0
 def test_parse_params_timeout(self):
     parsed = opener.parse('ftp://ftp.example.org?timeout=30')
     expected = ParseResult('ftp', None, None, 'ftp.example.org',
                            {'timeout': '30'}, None)
     self.assertEqual(expected, parsed)
예제 #9
0
 def test_parse_params_decode(self):
     parsed = opener.parse('ftp://ftp.example.org?decode=is%20working')
     expected = ParseResult('ftp', None, None, 'ftp.example.org',
                            {'decode': 'is working'}, None)
     self.assertEqual(expected, parsed)
예제 #10
0
 def test_parse_not_url(self):
     with self.assertRaises(opener.ParseError):
         parsed = opener.parse('foo/bar')
예제 #11
0
 def test_parse_resource_decode(self):
     parsed = opener.parse(
         'ftp://user%40large:[email protected]/%7Econnolly')
     expected = ParseResult('ftp', 'user@large', 'password',
                            'ftp.example.org/~connolly', {}, None)
     self.assertEqual(expected, parsed)
예제 #12
0
 def test_parse_user_password_decode(self):
     parsed = opener.parse('ftp://user%40large:[email protected]')
     expected = ParseResult('ftp', 'user@large', 'password',
                            'ftp.example.org', {}, None)
     self.assertEqual(expected, parsed)
예제 #13
0
 def test_parse_user_password_proxy(self):
     parsed = opener.parse(
         'ftp://*****:*****@ftp.example.org?proxy=ftp.proxy.org')
     expected = ParseResult('ftp', 'user', 'password', 'ftp.example.org',
                            {'proxy': 'ftp.proxy.org'}, None)
     self.assertEqual(expected, parsed)
예제 #14
0
 def test_parse_resource_decode(self):
     parsed = opener.parse(
         "ftp://user%40large:[email protected]/%7Econnolly")
     expected = ParseResult("ftp", "user@large", "password",
                            "ftp.example.org/~connolly", {}, None)
     self.assertEqual(expected, parsed)
예제 #15
0
 def test_parse_path(self):
     parsed = opener.parse('osfs://foo/bar!example.txt')
     expected = opener.registry.ParseResult('osfs', None, None, 'foo/bar',
                                            'example.txt')
     self.assertEqual(expected, parsed)
예제 #16
0
 def test_parse_params_decode(self):
     parsed = opener.parse("ftp://ftp.example.org?decode=is%20working")
     expected = ParseResult("ftp", None, None, "ftp.example.org",
                            {"decode": "is working"}, None)
     self.assertEqual(expected, parsed)
예제 #17
0
 def test_parse_params(self):
     parsed = opener.parse('ftp://ftp.example.org?proxy=ftp.proxy.org')
     expected = ParseResult('ftp', None, None, 'ftp.example.org',
                            {'proxy': 'ftp.proxy.org'}, None)
     self.assertEqual(expected, parsed)