[Sqlalchemy-commits] [5554] sqlalchemy/trunk/test/dialect/mssql.py: Added in MSGenericBinary to the
Brought to you by:
zzzeek
From: <co...@sq...> - 2008-12-29 22:07:31
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!-- #msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; } #msg dt { float: left; width: 6em; font-weight: bold; } #msg dt:after { content:':';} #msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; } #msg dl a { font-weight: bold} #msg dl a:link { color:#fc3; } #msg dl a:active { color:#ff0; } #msg dl a:visited { color:#cc6; } h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; } #msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; } #msg ul, pre { overflow: auto; } #header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; } #patch { width: 100%; } #patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;} #patch .propset h4, #patch .binary h4 {margin:0;} #patch pre {padding:0;line-height:1.2em;margin:0;} #patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;} #patch .propset .diff, #patch .binary .diff {padding:10px 0;} #patch span {display:block;padding:0 10px;} #patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;} #patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;} #patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;} #patch .lines, .info {color:#888;background:#fff;} --></style> <title>[5554] sqlalchemy/trunk/test/dialect/mssql.py: Added in MSGenericBinary to the mssql dialect tests.</title> </head> <body> <div id="msg"> <dl> <dt>Revision</dt> <dd>5554</dd> <dt>Author</dt> <dd>empty</dd> <dt>Date</dt> <dd>2008-12-29 16:38:04 -0500 (Mon, 29 Dec 2008)</dd> </dl> <h3>Log Message</h3> <pre>Added in MSGenericBinary to the mssql dialect tests.</pre> <h3>Modified Paths</h3> <ul> <li><a href="#sqlalchemytrunktestdialectmssqlpy">sqlalchemy/trunk/test/dialect/mssql.py</a></li> </ul> </div> <div id="patch"> <h3>Diff</h3> <a id="sqlalchemytrunktestdialectmssqlpy"></a> <div class="modfile"><h4>Modified: sqlalchemy/trunk/test/dialect/mssql.py (5553 => 5554)</h4> <pre class="diff"><span> <span class="info">--- sqlalchemy/trunk/test/dialect/mssql.py 2008-12-29 20:25:11 UTC (rev 5553) +++ sqlalchemy/trunk/test/dialect/mssql.py 2008-12-29 21:38:04 UTC (rev 5554) </span><span class="lines">@@ -555,9 +555,14 @@ </span><span class="cx"> 'VARBINARY(10)'), </span><span class="cx"> </span><span class="cx"> (mssql.MSImage, [], {}, </span><del>- 'IMAGE') - ] </del><ins>+ 'IMAGE'), </ins><span class="cx"> </span><ins>+ (types.Binary, [], {}, + 'IMAGE'), + (types.Binary, [10], {}, + 'BINARY(10)') + ] + </ins><span class="cx"> table_args = ['test_mssql_binary', MetaData(testing.db)] </span><span class="cx"> for index, spec in enumerate(columns): </span><span class="cx"> type_, args, kw, res = spec </span><span class="lines">@@ -580,7 +585,11 @@ </span><span class="cx"> </span><span class="cx"> reflected_binary = Table('test_mssql_binary', MetaData(testing.db), autoload=True) </span><span class="cx"> for col in reflected_binary.c: </span><del>- testing.eq_(col.type.__class__, binary_table.c[col.name].type.__class__) </del><ins>+ # don't test the MSGenericBinary since it's a special case and + # reflected it will map to a MSImage or MSBinary depending + if not testing.db.dialect.type_descriptor(binary_table.c[col.name].type).__class__ == mssql.MSGenericBinary: + testing.eq_(testing.db.dialect.type_descriptor(col.type).__class__, + testing.db.dialect.type_descriptor(binary_table.c[col.name].type).__class__) </ins><span class="cx"> if binary_table.c[col.name].type.length: </span><span class="cx"> testing.eq_(col.type.length, binary_table.c[col.name].type.length) </span><span class="cx"> binary_table.drop() </span><span class="lines">@@ -864,7 +873,7 @@ </span><span class="cx"> def tearDownAll(self): </span><span class="cx"> binary_table.drop() </span><span class="cx"> </span><del>- def testbinary(self): </del><ins>+ def test_binary(self): </ins><span class="cx"> testobj1 = pickleable.Foo('im foo 1') </span><span class="cx"> testobj2 = pickleable.Foo('im foo 2') </span><span class="cx"> testobj3 = pickleable.Foo('im foo 3') </span></span></pre> </div> </div> </body> </html> |