diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-01-17 20:43:35 +0000 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-01-17 20:43:35 +0000 |
| commit | 151fa4e75ce951e42068b3a5785e06a8ecf4dd44 (patch) | |
| tree | 8b3958e357e37192fe4c233fa181e35ccc63096a /test | |
| parent | 2b1937a31e5b5d8de56f266ec7692a3d0dd90976 (diff) | |
| download | sqlalchemy-151fa4e75ce951e42068b3a5785e06a8ecf4dd44.tar.gz | |
statement_options -> execution_options
Diffstat (limited to 'test')
| -rw-r--r-- | test/dialect/test_postgresql.py | 12 | ||||
| -rw-r--r-- | test/orm/test_query.py | 22 | ||||
| -rw-r--r-- | test/sql/test_generative.py | 36 |
3 files changed, 35 insertions, 35 deletions
diff --git a/test/dialect/test_postgresql.py b/test/dialect/test_postgresql.py index 5d6bcaf6d..c841accda 100644 --- a/test/dialect/test_postgresql.py +++ b/test/dialect/test_postgresql.py @@ -1455,19 +1455,19 @@ class ServerSideCursorsTest(TestBase, AssertsExecutionResults): # It should be off globally ... assert not result.cursor.name - s = select([1]).statement_options(stream_results=True) + s = select([1]).execution_options(stream_results=True) result = engine.execute(s) # ... but enabled for this one. assert result.cursor.name def test_ss_explicitly_disabled(self): - s = select([1]).statement_options(stream_results=False) + s = select([1]).execution_options(stream_results=False) result = ss_engine.execute(s) assert not result.cursor.name def test_aliases_and_ss(self): engine = engines.testing_engine(options={'server_side_cursors':False}) - s1 = select([1]).statement_options(stream_results=True).alias() + s1 = select([1]).execution_options(stream_results=True).alias() result = engine.execute(s1) assert result.cursor.name @@ -1500,12 +1500,12 @@ class ServerSideCursorsTest(TestBase, AssertsExecutionResults): assert not result.cursor.name, result.cursor.name result.close() - q = sess.query(Foo).statement_options(stream_results=True) + q = sess.query(Foo).execution_options(stream_results=True) result = engine.execute(q.statement) assert result.cursor.name result.close() - result = sess.query(Foo).statement_options(stream_results=True).subquery().execute() + result = sess.query(Foo).execution_options(stream_results=True).subquery().execute() assert result.cursor.name result.close() finally: @@ -1516,7 +1516,7 @@ class ServerSideCursorsTest(TestBase, AssertsExecutionResults): s = text('select 42') result = engine.execute(s) assert not result.cursor.name - s = text('select 42', statement_options=dict(stream_results=True)) + s = text('select 42', execution_options=dict(stream_results=True)) result = engine.execute(s) assert result.cursor.name diff --git a/test/orm/test_query.py b/test/orm/test_query.py index cd89f4d92..22dd20209 100644 --- a/test/orm/test_query.py +++ b/test/orm/test_query.py @@ -3748,27 +3748,27 @@ class UpdateDeleteTest(_base.MappedTest): class StatementOptionsTest(QueryTest): - """ Make sure a Query's statement_options are passed on to the + """ Make sure a Query's execution_options are passed on to the resulting statement. """ def test_query_with_statement_option(self): sess = create_session(bind=testing.db, autocommit=False) q1 = sess.query(User) - assert q1._statement_options == dict() - q2 = q1.statement_options(foo='bar', stream_results=True) + assert q1._execution_options == dict() + q2 = q1.execution_options(foo='bar', stream_results=True) # q1's options should be unchanged. - assert q1._statement_options == dict() + assert q1._execution_options == dict() # q2 should have them set. - assert q2._statement_options == dict(foo='bar', stream_results=True) - q3 = q2.statement_options(foo='not bar', answer=42) - assert q2._statement_options == dict(foo='bar', stream_results=True) + assert q2._execution_options == dict(foo='bar', stream_results=True) + q3 = q2.execution_options(foo='not bar', answer=42) + assert q2._execution_options == dict(foo='bar', stream_results=True) q3_options = dict(foo='not bar', stream_results=True, answer=42) - assert q3._statement_options == q3_options - assert q3.statement._statement_options == q3_options - assert q3._compile_context().statement._statement_options == q3_options - assert q3.subquery().original._statement_options == q3_options + assert q3._execution_options == q3_options + assert q3.statement._execution_options == q3_options + assert q3._compile_context().statement._execution_options == q3_options + assert q3.subquery().original._execution_options == q3_options # TODO: Test that statement options are passed on to # updates/deletes, but currently there are no such options diff --git a/test/sql/test_generative.py b/test/sql/test_generative.py index a9a1f59dd..893f2abd7 100644 --- a/test/sql/test_generative.py +++ b/test/sql/test_generative.py @@ -785,27 +785,27 @@ class SelectTest(TestBase, AssertsCompiledSQL): self.assert_compile(select_copy, "SELECT FOOBER table1.col1, table1.col2, table1.col3 FROM table1") self.assert_compile(s, "SELECT table1.col1, table1.col2, table1.col3 FROM table1") - def test_statement_options(self): - s = select().statement_options(foo='bar') - s2 = s.statement_options(bar='baz') - s3 = s.statement_options(foo='not bar') + def test_execution_options(self): + s = select().execution_options(foo='bar') + s2 = s.execution_options(bar='baz') + s3 = s.execution_options(foo='not bar') # The original select should not be modified. - assert s._statement_options == dict(foo='bar') - # s2 should have its statement_options based on s, though. - assert s2._statement_options == dict(foo='bar', bar='baz') - assert s3._statement_options == dict(foo='not bar') - - def test_statement_options_in_kwargs(self): - s = select(statement_options=dict(foo='bar')) - s2 = s.statement_options(bar='baz') + assert s._execution_options == dict(foo='bar') + # s2 should have its execution_options based on s, though. + assert s2._execution_options == dict(foo='bar', bar='baz') + assert s3._execution_options == dict(foo='not bar') + + def test_execution_options_in_kwargs(self): + s = select(execution_options=dict(foo='bar')) + s2 = s.execution_options(bar='baz') # The original select should not be modified. - assert s._statement_options == dict(foo='bar') - # s2 should have its statement_options based on s, though. - assert s2._statement_options == dict(foo='bar', bar='baz') + assert s._execution_options == dict(foo='bar') + # s2 should have its execution_options based on s, though. + assert s2._execution_options == dict(foo='bar', bar='baz') - def test_statement_options_in_text(self): - s = text('select 42', statement_options=dict(foo='bar')) - assert s._statement_options == dict(foo='bar') + def test_execution_options_in_text(self): + s = text('select 42', execution_options=dict(foo='bar')) + assert s._execution_options == dict(foo='bar') class InsertTest(TestBase, AssertsCompiledSQL): """Tests the generative capability of Insert""" |
