MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / test_prefixes

Method test_prefixes

test/sql/test_external_traversal.py:2822–2856  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2820 t2 = table("table2", column("col1"), column("col2"), column("col3"))
2821
2822 def test_prefixes(self):
2823 i = t1.insert()
2824 self.assert_compile(
2825 i,
2826 "INSERT INTO table1 (col1, col2, col3) "
2827 "VALUES (:col1, :col2, :col3)",
2828 )
2829
2830 gen = i.prefix_with("foober")
2831 self.assert_compile(
2832 gen,
2833 "INSERT foober INTO table1 (col1, col2, col3) "
2834 "VALUES (:col1, :col2, :col3)",
2835 )
2836
2837 self.assert_compile(
2838 i,
2839 "INSERT INTO table1 (col1, col2, col3) "
2840 "VALUES (:col1, :col2, :col3)",
2841 )
2842
2843 i2 = t1.insert().prefix_with("squiznart")
2844 self.assert_compile(
2845 i2,
2846 "INSERT squiznart INTO table1 (col1, col2, col3) "
2847 "VALUES (:col1, :col2, :col3)",
2848 )
2849
2850 gen2 = i2.prefix_with("quux")
2851 self.assert_compile(
2852 gen2,
2853 "INSERT squiznart quux INTO "
2854 "table1 (col1, col2, col3) "
2855 "VALUES (:col1, :col2, :col3)",
2856 )
2857
2858 def test_add_kwarg(self):
2859 i = t1.insert()

Callers

nothing calls this directly

Calls 3

assert_compileMethod · 0.80
prefix_withMethod · 0.80
insertMethod · 0.45

Tested by

no test coverage detected