mirror of
https://github.com/sqlalchemy/sqlalchemy.git
synced 2026-06-19 15:17:03 -04:00
just a pep8 pass of lib/sqlalchemy/testing/
This commit is contained in:
@@ -3,6 +3,7 @@ from ..engine.default import DefaultDialect
|
||||
from .. import util
|
||||
import re
|
||||
|
||||
|
||||
class AssertRule(object):
|
||||
|
||||
def process_execute(self, clauseelement, *multiparams, **params):
|
||||
@@ -40,6 +41,7 @@ class AssertRule(object):
|
||||
assert False, 'Rule has not been consumed'
|
||||
return self.is_consumed()
|
||||
|
||||
|
||||
class SQLMatchRule(AssertRule):
|
||||
def __init__(self):
|
||||
self._result = None
|
||||
@@ -56,6 +58,7 @@ class SQLMatchRule(AssertRule):
|
||||
|
||||
return True
|
||||
|
||||
|
||||
class ExactSQL(SQLMatchRule):
|
||||
|
||||
def __init__(self, sql, params=None):
|
||||
@@ -138,6 +141,7 @@ class RegexSQL(SQLMatchRule):
|
||||
_received_statement,
|
||||
_received_parameters)
|
||||
|
||||
|
||||
class CompiledSQL(SQLMatchRule):
|
||||
|
||||
def __init__(self, statement, params):
|
||||
@@ -217,6 +221,7 @@ class CountStatements(AssertRule):
|
||||
% (self.count, self._statement_count)
|
||||
return True
|
||||
|
||||
|
||||
class AllOf(AssertRule):
|
||||
|
||||
def __init__(self, *rules):
|
||||
@@ -244,6 +249,7 @@ class AllOf(AssertRule):
|
||||
def consume_final(self):
|
||||
return len(self.rules) == 0
|
||||
|
||||
|
||||
def _process_engine_statement(query, context):
|
||||
if util.jython:
|
||||
|
||||
@@ -256,6 +262,7 @@ def _process_engine_statement(query, context):
|
||||
query = re.sub(r'\n', '', query)
|
||||
return query
|
||||
|
||||
|
||||
def _process_assertion_statement(query, context):
|
||||
paramstyle = context.dialect.paramstyle
|
||||
if paramstyle == 'named':
|
||||
@@ -275,6 +282,7 @@ def _process_assertion_statement(query, context):
|
||||
|
||||
return query
|
||||
|
||||
|
||||
class SQLAssert(object):
|
||||
|
||||
rules = None
|
||||
@@ -311,4 +319,3 @@ class SQLAssert(object):
|
||||
executemany)
|
||||
|
||||
asserter = SQLAssert()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user