MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_urlattr

Method test_urlattr

test/engine/test_parseconnect.py:813–832  ·  view source on GitHub ↗

test the url attribute on ``Engine``.

(self)

Source from the content-addressed store, hash-verified

811 create_engine("notarealurl")
812
813 def test_urlattr(self):
814 """test the url attribute on ``Engine``."""
815
816 e = create_engine(
817 "mysql+mysqldb://scott:tiger@localhost/test",
818 module=mock_dbapi,
819 _initialize=False,
820 )
821 u = url.make_url("mysql+mysqldb://scott:tiger@localhost/test")
822 e2 = create_engine(u, module=mock_dbapi, _initialize=False)
823 assert e.url.drivername == e2.url.drivername == "mysql+mysqldb"
824 assert e.url.username == e2.url.username == "scott"
825 assert e2.url is u
826 eq_(
827 u.render_as_string(hide_password=False),
828 "mysql+mysqldb://scott:tiger@localhost/test",
829 )
830 assert repr(u) == "mysql+mysqldb://scott:***@localhost/test"
831 assert repr(e) == "Engine(mysql+mysqldb://scott:***@localhost/test)"
832 assert repr(e2) == "Engine(mysql+mysqldb://scott:***@localhost/test)"
833
834 def test_poolargs(self):
835 """test that connection pool args make it thru"""

Callers

nothing calls this directly

Calls 3

create_engineFunction · 0.90
eq_Function · 0.90
render_as_stringMethod · 0.80

Tested by

no test coverage detected