Skip to content

Commit

Permalink
Fix flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
andbag committed Apr 17, 2019
1 parent caa2dd6 commit ed38d23
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/Products/ZCatalog/tests/test_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ def numbers(self):
return (self.num, self.num + 1)

def getPhysicalPath(self):
return '/%s' % self.num
return '/{0}'.format(self.num)

def start(self):
return '2013-07-%.2d' % (self.num + 1)
return '2013-07-{0:0=2d}'.format(self.num + 1)

def end(self):
return '2013-07-%.2d' % (self.num + 2)
return '2013-07-{0:0=2d}'.format(self.num + 1)


class TestCatalogQueryKey(unittest.TestCase):
Expand All @@ -79,13 +79,13 @@ def _makeOne(self, catalog=None, query=None):

def test_get_id(self):
cache_key = self._makeOne()
self.assertEquals(cache_key.get_id(),
('', 'NonPersistentCatalog'))
self.assertEqual(cache_key.get_id(),
('', 'NonPersistentCatalog'))

def test_get_id_persistent(self):
zcat = ZCatalog('catalog')
cache_key = self._makeOne(zcat._catalog)
self.assertEquals(cache_key.get_id(), ('catalog', ))
self.assertEqual(cache_key.get_id(), ('catalog', ))


class TestCatalogQueryCaching(cleanup.CleanUp, unittest.TestCase):
Expand Down Expand Up @@ -134,7 +134,7 @@ def _apply_query(self, query):
transaction.get().commit()

stats = cache.getStatistics()

hits = stats[0]['hits']
misses = stats[0]['misses']

Expand All @@ -143,7 +143,7 @@ def _apply_query(self, query):
transaction.get().commit()

stats = cache.getStatistics()

# check if chache hits
self.assertEqual(stats[0]['hits'], hits + 2)
self.assertEqual(stats[0]['misses'], misses)
Expand Down

0 comments on commit ed38d23

Please sign in to comment.