コード例 #1
0
 def test_realGetAllThemes(self):
     """
     C{_realGetAllThemes} should collect themes from available offerings.
     """
     tc = webtheme.ThemeCache()
     ths = tc.getAllThemes()
     self.assertEqual([theme.name for theme in ths], ['foo', 'boz', 'baz'])
コード例 #2
0
 def test_clearThemeCache(self):
     """
     C{emptyCache} should invalidate the cache contents for both types.
     """
     tc = webtheme.ThemeCache()
     s = Store()
     tc.getAllThemes()
     tc.getInstalledThemes(s)
     tc.emptyCache()
     self.assertEqual(tc._getAllThemesCache, None)
     self.assertEqual(len(tc._getInstalledThemesCache), 0)
コード例 #3
0
 def test_getAllThemes(self):
     """
     C{getAllThemes} should collect themes from available
     offerings, and only call C{getOfferings} once no matter how
     many times it's called.
     """
     tc = webtheme.ThemeCache()
     ths = tc.getAllThemes()
     self.assertEqual([theme.name for theme in ths], ['foo', 'boz', 'baz'])
     tc.getAllThemes()
     self.assertEqual(self.called, 1)