MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_c_mutate_after_unpickle

Method test_c_mutate_after_unpickle

test/sql/test_metadata.py:2008–2026  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2006 assert_raises(TypeError, assign2)
2007
2008 def test_c_mutate_after_unpickle(self):
2009 m = MetaData()
2010
2011 y = Column("y", Integer)
2012 t1 = Table("t", m, Column("x", Integer), y)
2013
2014 # note we are testing immutable column collection here
2015 t2 = pickle.loads(pickle.dumps(t1))
2016 z = Column("z", Integer)
2017 g = Column("g", Integer)
2018 t2.append_column(z)
2019
2020 is_(t1.c.contains_column(y), True)
2021 is_(t2.c.contains_column(y), False)
2022 y2 = t2.c.y
2023 is_(t2.c.contains_column(y2), True)
2024
2025 is_(t2.c.contains_column(z), True)
2026 is_(t2.c.contains_column(g), False)
2027
2028 def test_table_ctor_duplicated_column_name(self):
2029 # when it will raise

Callers

nothing calls this directly

Calls 8

MetaDataClass · 0.90
ColumnClass · 0.90
TableClass · 0.90
is_Function · 0.90
loadsMethod · 0.45
dumpsMethod · 0.45
append_columnMethod · 0.45
contains_columnMethod · 0.45

Tested by

no test coverage detected