def test_default_cache_home(self): """Ensure default values work correctly.""" self.tweak_env('XDG_CACHE_HOME', None) expected = b'/blah' self.patch(basedir, 'default_cache_home', expected) self.assertFalse(os.environ.get('XDG_CACHE_HOME', False)) self.assertEqual(basedir.get_xdg_cache_home(), expected)
def test_cache_home(self): """Test that XDG_CACHE_HOME is handled correctly.""" self.tweak_env( 'XDG_CACHE_HOME', os.path.abspath(os.path.join(os.getcwd(), '_trial_temp', 'cache'))) self.assertEqual(os.environ['XDG_CACHE_HOME'].encode('utf-8'), basedir.get_xdg_cache_home())
def test_cache_home(self): """Test that XDG_CACHE_HOME is handled correctly.""" self.tweak_env('XDG_CACHE_HOME', os.path.abspath(os.path.join(os.getcwd(), '_trial_temp', 'cache'))) self.assertEqual(os.environ['XDG_CACHE_HOME'].encode('utf-8'), basedir.get_xdg_cache_home())