Skip to content

Commit

Permalink
Take over syntax checker suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
andbag committed Mar 31, 2016
1 parent 2f07c78 commit b9041a6
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/Products/PluginIndexes/common/tests/test_UnIndex.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ def _makeOne(self, *args, **kw):

def _makeConflicted(self):
from ZODB.POSException import ConflictError

class Conflicted:
def __str__(self):
return 'Conflicted'
__repr__ = __str__

def __getattr__(self, id, default=object()):
raise ConflictError, 'testing'
raise ConflictError('testing')
return Conflicted()

def test_empty(self):
Expand All @@ -54,16 +56,19 @@ def test_get_object_datum(self):
class DummyContent2(object):
interesting = 'GOT IT'
dummy = DummyContent2()
self.assertEquals(idx._get_object_datum(dummy, 'interesting'), 'GOT IT')
self.assertEquals(idx._get_object_datum(dummy, 'interesting'),
'GOT IT')

class DummyContent3(object):
exc = None

def interesting(self):
if self.exc:
raise self.exc
return 'GOT IT'
dummy = DummyContent3()
self.assertEquals(idx._get_object_datum(dummy, 'interesting'), 'GOT IT')
self.assertEquals(idx._get_object_datum(dummy, 'interesting'),
'GOT IT')

dummy.exc = AttributeError
self.assertEquals(idx._get_object_datum(dummy, 'interesting'), _marker)
Expand Down

0 comments on commit b9041a6

Please sign in to comment.