Skip to content

Commit

Permalink
rebase, fix tests, remove code_analysis warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
do3cc committed Feb 19, 2015
1 parent 18eff55 commit 293012f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions src/collective/solr/browser/maintenance.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ def checkPoint():
obj.portal_type in ignore_portal_types:
continue

if (only_portal_types and \
obj.portal_type in only_portal_types) or \
not only_portal_types:
if (only_portal_types and
obj.portal_type in only_portal_types) or \
not only_portal_types:

data, missing = proc.getData(obj)
prepareData(data)
Expand Down
20 changes: 10 additions & 10 deletions src/collective/solr/tests/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,51 +154,51 @@ def testReindexPortalTypesParameters(self):
# initially the solr index should be empty
self.assertEqual(numFound(self.search()), 0)

## first test the only_portal_types parameter
# first test the only_portal_types parameter
maintenance.reindex(only_portal_types=[])
self.assertEqual(numFound(self.search()), 8)
maintenance.clear()

maintenance.reindex(only_portal_types=['Folder'])
self.assertEqual(numFound(self.search()), 4)
self.assertEqual(numFound(self.search()), 5)
maintenance.clear()

maintenance.reindex(only_portal_types=['Folder', 'Collection'])
self.assertEqual(numFound(self.search()), 6)
self.assertEqual(numFound(self.search()), 7)
maintenance.clear()

maintenance.reindex(
only_portal_types=['Folder', 'Collection', 'NotExistingPortalType']
)
self.assertEqual(numFound(self.search()), 6)
self.assertEqual(numFound(self.search()), 7)
maintenance.clear()

## then the ignore_portal_types
# then the ignore_portal_types
maintenance.reindex(ignore_portal_types=[])
self.assertEqual(numFound(self.search()), 8)
maintenance.clear()

maintenance.reindex(ignore_portal_types=['Folder'])
self.assertEqual(numFound(self.search()), 4)
self.assertEqual(numFound(self.search()), 3)
maintenance.clear()

maintenance.reindex(ignore_portal_types=['Folder', 'Collection'])
self.assertEqual(numFound(self.search()), 2)
self.assertEqual(numFound(self.search()), 1)
maintenance.clear()

maintenance.reindex(
ignore_portal_types=['Folder', 'Collection',
'NotExistingPortalType']
)
self.assertEqual(numFound(self.search()), 2)
self.assertEqual(numFound(self.search()), 1)
maintenance.clear()

## and then both, which is not supported
# and then both, which is not supported
msg = maintenance.reindex(ignore_portal_types=['Collection'],
only_portal_types=['Folder'])
self.assertEquals(
msg,
'It is not possible to combine ignore_portal_types with ' \
'It is not possible to combine ignore_portal_types with '
'only_portal_types')

def testPartialReindex(self):
Expand Down

0 comments on commit 293012f

Please sign in to comment.