[grassyknoll commit] r987 - branches/unhork/grassyknoll/tests

0 views
Skip to first unread message

codesite...@google.com

unread,
Jan 7, 2009, 4:31:23 AM1/7/09
to grassykno...@googlegroups.com
Author: jemfinch
Date: Wed Jan 7 01:14:21 2009
New Revision: 987

Modified:
branches/unhork/grassyknoll/tests/test_Model.py

Log:
Fixed spacing to be PEP-8 compliant.


Modified: branches/unhork/grassyknoll/tests/test_Model.py
==============================================================================
--- branches/unhork/grassyknoll/tests/test_Model.py (original)
+++ branches/unhork/grassyknoll/tests/test_Model.py Wed Jan 7 01:14:21 2009
@@ -45,14 +45,14 @@

def test_Schema():
# make sure we no longer support arbitrary kwargs
- assert_raises(TypeError, MySchema, pants = "jeans", shirt="cotton")
+ assert_raises(TypeError, MySchema, pants="jeans", shirt="cotton")

schema = MySchema()
assert isinstance(schema.newField, Factory.Factory)
assert not hasattr(schema.newField, 'pants')
assert not hasattr(schema.newField, 'shirt')

- schema2 = schema.default(pants = "jeans", shirt="cotton")
+ schema2 = schema.default(pants="jeans", shirt="cotton")
assert schema2 is schema
assert schema.newField.pants == "jeans"
assert schema.newField.shirt == "cotton"
@@ -99,8 +99,8 @@
assert model.sub3.title.wrapped is unicode

# assignment by call
- model(post_date = datetime.datetime,
- description = unicode)
+ model(post_date=datetime.datetime,
+ description=unicode)

assert model.post_date is datetime.datetime
assert model.sub1.post_date.wrapped is datetime.datetime
@@ -151,7 +151,7 @@
assert_raises(AttributeError, setattr,
_, "nonesuch", "whocares")

# fancy on-demand attribute creation
- with model.cost(type = float) as _:
+ with model.cost(type=float) as _:
assert isinstance(_, SchemaProxy)
assert _.name == "cost"
assert _.model is model
@@ -216,9 +216,9 @@
assert model.price is float
assert isinstance(norm.price, Norman.Float)

- with model.description(type = unicode) as _:
+ with model.description(type=unicode) as _:
assert model.description is unicode
- _.norm = Norman.Unicode(errors = 'replace')
+ _.norm = Norman.Unicode(errors='replace')

assert isinstance(norm.description, Norman.Unicode)
assert norm.description.errors == 'replace'
@@ -266,9 +266,9 @@
assert table.price.type is float
assert table.price.indexed == False

- with model.description(type = unicode) as _:
+ with model.description(type=unicode) as _:
assert model.description is unicode
- _.table = TableMaker.Column(unicode, indexed = False)
+ _.table = TableMaker.Column(unicode, indexed=False)

assert isinstance(table.description, TableMaker.Column)
assert table.description.indexed == False
@@ -283,7 +283,7 @@
def test_Model_with_LuceneNorman():
norm = LuceneCollection.LuceneNorman()

- with Model(norm = norm) as model:
+ with Model(norm=norm) as model:

assert model.norm is norm

@@ -294,18 +294,18 @@
#assert norm.size.fact.getCallable() is Smarts.SmartField

def test_Realistic_Model():
- with Model(fixture = Norman.Object(unknown='delete').\
- default(optional=False), # XXX this
won't work right
- lucene =
LuceneCollection.LuceneNorman(unknown='delete').\
- default(store = True), # XXX
nor this
- table = TableMaker.Table('nsf')
+ with Model(fixture=Norman.Object(unknown='delete').\
+ default(optional=False), # XXX this
won't work right
+ lucene=LuceneCollection.LuceneNorman(unknown='delete').\
+ default(store=True), # XXX nor
this
+ table=TableMaker.Table('nsf')
) as model:

- #model.fixture.newField.bind(store = True, optional = False)
+ #model.fixture.newField.bind(store=True, optional=False)

assert isinstance(model, Model)

- with model.Date(type = datetime.date) as _:
+ with model.Date(type=datetime.date) as _:
_.lucene.store = True
_.lucene.index = 'untokenized'
_.lucene.optional = True

Reply all
Reply to author
Forward
0 new messages