summaryrefslogtreecommitdiff
path: root/test/sql/test_selectable.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2012-07-28 15:50:05 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2012-07-28 15:50:05 -0400
commit27913554a85c308d81e6c018669d0246ceecc639 (patch)
tree191305298ce66000c95c9c8fec1e27350f0d206e /test/sql/test_selectable.py
parent90571b3a3a4eca329ec14e9bd142ad2b96526d99 (diff)
downloadsqlalchemy-27913554a85c308d81e6c018669d0246ceecc639.tar.gz
trailing whitespace bonanza
Diffstat (limited to 'test/sql/test_selectable.py')
-rw-r--r--test/sql/test_selectable.py82
1 files changed, 41 insertions, 41 deletions
diff --git a/test/sql/test_selectable.py b/test/sql/test_selectable.py
index b2b8ce187..161eeaff4 100644
--- a/test/sql/test_selectable.py
+++ b/test/sql/test_selectable.py
@@ -44,8 +44,8 @@ class SelectableTest(fixtures.TestBase, AssertsExecutionResults, AssertsCompiled
s = select([table1.c.col1.label('c2'), table1.c.col1,
table1.c.col1.label('c1')])
- # this tests the same thing as
- # test_direct_correspondence_on_labels below -
+ # this tests the same thing as
+ # test_direct_correspondence_on_labels below -
# that the presence of label() affects the 'distance'
assert s.corresponding_column(table1.c.col1) is s.c.col1
@@ -148,11 +148,11 @@ class SelectableTest(fixtures.TestBase, AssertsExecutionResults, AssertsCompiled
is j2.c.table1_col1
def test_clone_append_column(self):
- sel = select([literal_column('1').label('a')])
+ sel = select([literal_column('1').label('a')])
cloned = visitors.ReplacingCloningVisitor().traverse(sel)
- cloned.append_column(literal_column('2').label('b'))
- cloned.append_column(func.foo())
- eq_(cloned.c.keys(), ['a', 'b', 'foo()'])
+ cloned.append_column(literal_column('2').label('b'))
+ cloned.append_column(func.foo())
+ eq_(cloned.c.keys(), ['a', 'b', 'foo()'])
def test_append_column_after_replace_selectable(self):
basesel = select([literal_column('1').label('a')])
@@ -173,7 +173,7 @@ class SelectableTest(fixtures.TestBase, AssertsExecutionResults, AssertsCompiled
"JOIN (SELECT 1 AS a, 2 AS b) AS joinfrom "
"ON basefrom.a = joinfrom.a"
)
- replaced.append_column(joinfrom.c.b)
+ replaced.append_column(joinfrom.c.b)
self.assert_compile(
replaced,
"SELECT basefrom.a, joinfrom.b FROM (SELECT 1 AS a) AS basefrom "
@@ -253,7 +253,7 @@ class SelectableTest(fixtures.TestBase, AssertsExecutionResults, AssertsCompiled
assert u.corresponding_column(s2.c.table2_col2) is u.c.col2
def test_union_precedence(self):
- # conflicting column correspondence should be resolved based on
+ # conflicting column correspondence should be resolved based on
# the order of the select()s in the union
s1 = select([table1.c.col1, table1.c.col2])
@@ -460,9 +460,9 @@ class SelectableTest(fixtures.TestBase, AssertsExecutionResults, AssertsCompiled
eq_(c1._from_objects, [t])
eq_(c2._from_objects, [t])
- self.assert_compile(select([c1]),
+ self.assert_compile(select([c1]),
"SELECT t.c1 FROM t")
- self.assert_compile(select([c2]),
+ self.assert_compile(select([c2]),
"SELECT t.c2 FROM t")
def test_from_list_deferred_whereclause(self):
@@ -476,9 +476,9 @@ class SelectableTest(fixtures.TestBase, AssertsExecutionResults, AssertsCompiled
eq_(c1._from_objects, [t])
eq_(c2._from_objects, [t])
- self.assert_compile(select([c1]),
+ self.assert_compile(select([c1]),
"SELECT t.c1 FROM t")
- self.assert_compile(select([c2]),
+ self.assert_compile(select([c2]),
"SELECT t.c2 FROM t")
def test_from_list_deferred_fromlist(self):
@@ -492,7 +492,7 @@ class SelectableTest(fixtures.TestBase, AssertsExecutionResults, AssertsCompiled
eq_(c1._from_objects, [t2])
- self.assert_compile(select([c1]),
+ self.assert_compile(select([c1]),
"SELECT t2.c1 FROM t2")
def test_from_list_deferred_cloning(self):
@@ -514,20 +514,20 @@ class SelectableTest(fixtures.TestBase, AssertsExecutionResults, AssertsCompiled
table1 = table('t1', column('a'))
table2 = table('t2', column('b'))
s1 = select([table1.c.a, table2.c.b])
- self.assert_compile(s1,
+ self.assert_compile(s1,
"SELECT t1.a, t2.b FROM t1, t2"
)
s2 = s1.with_only_columns([table2.c.b])
- self.assert_compile(s2,
+ self.assert_compile(s2,
"SELECT t2.b FROM t2"
)
s3 = sql_util.ClauseAdapter(table1).traverse(s1)
- self.assert_compile(s3,
+ self.assert_compile(s3,
"SELECT t1.a, t2.b FROM t1, t2"
)
s4 = s3.with_only_columns([table2.c.b])
- self.assert_compile(s4,
+ self.assert_compile(s4,
"SELECT t2.b FROM t2"
)
@@ -683,13 +683,13 @@ class JoinConditionTest(fixtures.TestBase, AssertsExecutionResults):
def test_join_cond_no_such_unrelated_table(self):
m = MetaData()
- # bounding the "good" column with two "bad" ones is so to
+ # bounding the "good" column with two "bad" ones is so to
# try to get coverage to get the "continue" statements
# in the loop...
- t1 = Table('t1', m,
+ t1 = Table('t1', m,
Column('y', Integer, ForeignKey('t22.id')),
- Column('x', Integer, ForeignKey('t2.id')),
- Column('q', Integer, ForeignKey('t22.id')),
+ Column('x', Integer, ForeignKey('t2.id')),
+ Column('q', Integer, ForeignKey('t22.id')),
)
t2 = Table('t2', m, Column('id', Integer))
assert sql_util.join_condition(t1, t2).compare(t1.c.x==t2.c.id)
@@ -697,7 +697,7 @@ class JoinConditionTest(fixtures.TestBase, AssertsExecutionResults):
def test_join_cond_no_such_unrelated_column(self):
m = MetaData()
- t1 = Table('t1', m, Column('x', Integer, ForeignKey('t2.id')),
+ t1 = Table('t1', m, Column('x', Integer, ForeignKey('t2.id')),
Column('y', Integer, ForeignKey('t3.q')))
t2 = Table('t2', m, Column('id', Integer))
t3 = Table('t3', m, Column('id', Integer))
@@ -798,11 +798,11 @@ class PrimaryKeyTest(fixtures.TestBase, AssertsExecutionResults):
def test_init_doesnt_blowitaway(self):
meta = MetaData()
- a = Table('a', meta,
- Column('id', Integer, primary_key=True),
+ a = Table('a', meta,
+ Column('id', Integer, primary_key=True),
Column('x', Integer))
- b = Table('b', meta,
- Column('id', Integer, ForeignKey('a.id'), primary_key=True),
+ b = Table('b', meta,
+ Column('id', Integer, ForeignKey('a.id'), primary_key=True),
Column('x', Integer))
j = a.join(b)
@@ -813,11 +813,11 @@ class PrimaryKeyTest(fixtures.TestBase, AssertsExecutionResults):
def test_non_column_clause(self):
meta = MetaData()
- a = Table('a', meta,
- Column('id', Integer, primary_key=True),
+ a = Table('a', meta,
+ Column('id', Integer, primary_key=True),
Column('x', Integer))
- b = Table('b', meta,
- Column('id', Integer, ForeignKey('a.id'), primary_key=True),
+ b = Table('b', meta,
+ Column('id', Integer, ForeignKey('a.id'), primary_key=True),
Column('x', Integer, primary_key=True))
j = a.join(b, and_(a.c.id==b.c.id, b.c.x==5))
@@ -832,7 +832,7 @@ class PrimaryKeyTest(fixtures.TestBase, AssertsExecutionResults):
Column('id', Integer, primary_key= True),
)
- engineer = Table('Engineer', metadata,
+ engineer = Table('Engineer', metadata,
Column('id', Integer,
ForeignKey('Employee.id'), primary_key=True))
@@ -929,8 +929,8 @@ class ReduceTest(fixtures.TestBase, AssertsExecutionResults):
'BaseItem':
base_item_table.select(
base_item_table.c.child_name
- == 'BaseItem'),
- 'Item': base_item_table.join(item_table)},
+ == 'BaseItem'),
+ 'Item': base_item_table.join(item_table)},
None, 'item_join')
eq_(util.column_set(sql_util.reduce_columns([item_join.c.id,
item_join.c.dummy, item_join.c.child_name])),
@@ -969,7 +969,7 @@ class ReduceTest(fixtures.TestBase, AssertsExecutionResults):
select([
page_table.c.id,
- magazine_page_table.c.page_id,
+ magazine_page_table.c.page_id,
cast(null(), Integer).label('magazine_page_id')
]).
select_from(page_table.join(magazine_page_table))
@@ -987,7 +987,7 @@ class ReduceTest(fixtures.TestBase, AssertsExecutionResults):
pjoin = union(select([
page_table.c.id,
- magazine_page_table.c.page_id,
+ magazine_page_table.c.page_id,
cast(null(), Integer).label('magazine_page_id')
]).
select_from(page_table.join(magazine_page_table)),
@@ -1116,7 +1116,7 @@ class AnnotationsTest(fixtures.TestBase):
assert t1.c is t2.c
assert t1.c.col1 is t2.c.col1
- inner = select([s1])
+ inner = select([s1])
assert inner.corresponding_column(t2.c.col1,
require_embedded=False) \
@@ -1190,7 +1190,7 @@ class AnnotationsTest(fixtures.TestBase):
b4._annotations, b4.left._annotations:
assert elem == {}
- assert b2.left is not bin.left
+ assert b2.left is not bin.left
assert b3.left is not b2.left is not bin.left
assert b4.left is bin.left # since column is immutable
# deannotate copies the element
@@ -1203,7 +1203,7 @@ class AnnotationsTest(fixtures.TestBase):
#2453 - however note this was modified by
#1401, and it's likely that re49563072578
is helping us with the str() comparison
- case now, as deannotate is making
+ case now, as deannotate is making
clones again in some cases.
"""
table1 = table('table1', column('x'))
@@ -1240,7 +1240,7 @@ class AnnotationsTest(fixtures.TestBase):
def test_annotate_varied_annot_same_col(self):
"""test two instances of the same column with different annotations
preserving them when deep_annotate is run on them.
-
+
"""
t1 = table('table1', column("col1"), column("col2"))
s = select([t1.c.col1._annotate({"foo":"bar"})])
@@ -1271,11 +1271,11 @@ class AnnotationsTest(fixtures.TestBase):
)
def test_deannotate_3(self):
- table1 = table('table1', column("col1"), column("col2"),
+ table1 = table('table1', column("col1"), column("col2"),
column("col3"), column("col4"))
j = and_(
table1.c.col1._annotate({"remote":True})==
- table1.c.col2._annotate({"local":True}),
+ table1.c.col2._annotate({"local":True}),
table1.c.col3._annotate({"remote":True})==
table1.c.col4._annotate({"local":True})
)