def test_default_data_home(self): """Ensure default values work correctly.""" self.tweak_env('XDG_DATA_HOME', None) expected = b'/blah' self.patch(basedir, 'default_data_home', expected) self.assertFalse(os.environ.get('XDG_DATA_HOME', False)) self.assertEqual(basedir.get_xdg_data_home(), expected)
def test_data_home(self): """Test that XDG_DATA_HOME is handled correctly.""" self.tweak_env('XDG_DATA_HOME', os.path.abspath(os.path.join(os.getcwd(), '_trial_temp', 'xdg_data'))) self.assertEqual(os.environ['XDG_DATA_HOME'].encode('utf-8'), basedir.get_xdg_data_home())
def test_data_home(self): """Test that XDG_DATA_HOME is handled correctly.""" self.tweak_env( 'XDG_DATA_HOME', os.path.abspath( os.path.join(os.getcwd(), '_trial_temp', 'xdg_data'))) self.assertEqual(os.environ['XDG_DATA_HOME'].encode('utf-8'), basedir.get_xdg_data_home())