MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_basic

Method test_basic

test/engine/test_reflection.py:1730–1755  ·  view source on GitHub ↗
(self, connection)

Source from the content-addressed store, hash-verified

1728
1729 @testing.requires.unicode_connections
1730 def test_basic(self, connection):
1731 # the 'convert_unicode' should not get in the way of the
1732 # reflection process. reflect_table for oracle, postgresql
1733 # (others?) expect non-unicode strings in result sets/bind
1734 # params
1735
1736 names = {rec[0] for rec in self.names}
1737
1738 reflected = set(inspect(connection).get_table_names())
1739
1740 if not names.issubset(reflected) and hasattr(unicodedata, "normalize"):
1741 # Python source files in the utf-8 coding seem to
1742 # normalize literals as NFC (and the above are
1743 # explicitly NFC). Maybe this database normalizes NFD
1744 # on reflection.
1745
1746 nfc = {unicodedata.normalize("NFC", n) for n in names}
1747 self.assert_(nfc == names)
1748
1749 # Yep. But still ensure that bulk reflection and
1750 # create/drop work with either normalization.
1751
1752 r = MetaData()
1753 r.reflect(connection)
1754 r.drop_all(connection, checkfirst=False)
1755 r.create_all(connection, checkfirst=False)
1756
1757 @testing.requires.unicode_connections
1758 def test_get_names(self, connection):

Callers

nothing calls this directly

Calls 9

reflectMethod · 0.95
drop_allMethod · 0.95
create_allMethod · 0.95
inspectFunction · 0.90
MetaDataClass · 0.90
get_table_namesMethod · 0.45
issubsetMethod · 0.45
normalizeMethod · 0.45
assert_Method · 0.45

Tested by

no test coverage detected