Only call _invalidate_all if it exists

the memoize decorator adds the _invalidate_all function when called.
Due to the deferred initialization that may not happen in a test.
This commit is contained in:
Ludwig Nussel 2016-05-10 10:29:37 +02:00
parent 28831300fc
commit 70c3d34731

View File

@ -48,7 +48,8 @@ class TestApiCalls(unittest.TestCase):
def tearDown(self):
"""Clean internal cache"""
self.api._invalidate_all()
if hasattr(self.api, '_invalidate_all'):
self.api._invalidate_all()
def test_ring_packages(self):
"""