54
49
class PyDateProcessorTest(_DateProcessorTest):
52
from sqlalchemy import processors
53
cls.module = type("util", (object,),
56
for k, v in processors.py_fallback().items()
58
60
class CDateProcessorTest(_DateProcessorTest):
59
61
__requires__ = ('cextensions',)
64
from sqlalchemy import cprocessors
65
cls.module = cprocessors
68
class _DistillArgsTest(fixtures.TestBase):
69
def test_distill_none(self):
71
self.module._distill_params(None, None),
75
def test_distill_no_multi_no_param(self):
77
self.module._distill_params((), {}),
81
def test_distill_dict_multi_none_param(self):
83
self.module._distill_params(None, {"foo": "bar"}),
87
def test_distill_dict_multi_empty_param(self):
89
self.module._distill_params((), {"foo": "bar"}),
93
def test_distill_single_dict(self):
95
self.module._distill_params(({"foo": "bar"},), {}),
99
def test_distill_single_list_strings(self):
101
self.module._distill_params((["foo", "bar"],), {}),
105
def test_distill_single_list_tuples(self):
107
self.module._distill_params(([("foo", "bar"), ("bat", "hoho")],), {}),
108
[('foo', 'bar'), ('bat', 'hoho')]
111
def test_distill_single_list_tuple(self):
113
self.module._distill_params(([("foo", "bar")],), {}),
117
def test_distill_multi_list_tuple(self):
119
self.module._distill_params(
120
([("foo", "bar")], [("bar", "bat")]),
123
([('foo', 'bar')], [('bar', 'bat')])
126
def test_distill_multi_strings(self):
128
self.module._distill_params(("foo", "bar"), {}),
132
def test_distill_single_list_dicts(self):
134
self.module._distill_params(([{"foo": "bar"}, {"foo": "hoho"}],), {}),
135
[{'foo': 'bar'}, {'foo': 'hoho'}]
138
def test_distill_single_string(self):
140
self.module._distill_params(("arg",), {}),
144
def test_distill_multi_string_tuple(self):
146
self.module._distill_params((("arg", "arg"),), {}),
152
class PyDistillArgsTest(_DistillArgsTest):
154
def setup_class(cls):
155
from sqlalchemy.engine import util
156
cls.module = type("util", (object,),
159
for k, v in util.py_fallback().items()
163
class CDistillArgsTest(_DistillArgsTest):
164
__requires__ = ('cextensions', )
166
def setup_class(cls):
167
from sqlalchemy import cutils as util