MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_rfc1738

Method test_rfc1738

test/engine/test_parseconnect.py:73–114  ·  view source on GitHub ↗
(self, text)

Source from the content-addressed store, hash-verified

71 "dbtype://user🐍測試:pass🐍測試@hostspec:499?query=but_no_db",
72 )
73 def test_rfc1738(self, text):
74 u = url.make_url(text)
75
76 assert u.drivername in ("dbtype", "dbtype+apitype")
77 assert u.username in (
78 "username",
79 "user%&|",
80 "username with space+and+plus",
81 "user🐍測試",
82 None,
83 )
84 assert u.password in (
85 "password",
86 "password with spaces",
87 "password with space+and+plus",
88 "apples/oranges",
89 "pass%&|",
90 "pass🐍測試",
91 None,
92 )
93 assert u.host in (
94 "hostspec",
95 "127.0.0.1",
96 "2001:da8:2004:1000:202:116:160:90",
97 "",
98 None,
99 ), u.host
100 assert u.database in (
101 "database",
102 "test+database with@atsign",
103 "test database with spaces",
104 "/usr/local/_xtest@example.com/members.db",
105 "/usr/db_file.db",
106 ":memory:",
107 "",
108 "foo/bar/im/a/file",
109 "E:/work/src/LEM/db/hello.db",
110 "db?with=qmark",
111 None,
112 ), u.database
113
114 eq_(url.make_url(u.render_as_string(hide_password=False)), u)
115
116 def test_dont_urlescape_slashes(self):
117 """supplemental test for #11234 where we want to not escape slashes

Callers

nothing calls this directly

Calls 2

eq_Function · 0.90
render_as_stringMethod · 0.80

Tested by

no test coverage detected