예제 #1
0
    def testCacheFilenameSuffixOption(self):
        new_config = {'cache_filename_suffix': 'blarg'}
        new_config.update(self.config)
        cache = files.FilesCache(new_config, config.MAP_PASSWORD)

        cache.CACHE_FILENAME = 'test'
        self.assertEqual(os.path.join(self.workdir, 'test.blarg'),
                         cache.GetCacheFilename())

        cache.temp_cache_file = open(os.path.join(self.workdir, 'pre-commit'),
                                     'w')
        cache.temp_cache_file.write('\n')
        cache.temp_cache_filename = os.path.join(self.workdir, 'pre-commit')
        cache._Commit()
        expected_cache_filename = os.path.join(self.workdir, 'test.blarg')
        self.failUnless(os.path.exists(expected_cache_filename))
예제 #2
0
 def testInstantiation(self):
     cache = files.FilesCache(self.config, config.MAP_PASSWORD)
     self.failIfEqual(None, cache)