From 0cba7241edc748d1863bb028228a94049ff93693 Mon Sep 17 00:00:00 2001 From: Jon Dugan Date: Mon, 22 Feb 2010 12:57:13 -0600 Subject: generalize test_current_working_directory() to avoid symlink confusions --- src/mailman/tests/test_configfile.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/mailman/tests/test_configfile.py b/src/mailman/tests/test_configfile.py index ea393ca38..211064acb 100644 --- a/src/mailman/tests/test_configfile.py +++ b/src/mailman/tests/test_configfile.py @@ -95,16 +95,15 @@ class TestConfigFileSearch(TestConfigFileBase): def test_current_working_directory(self): fake_cwd = '/home/alex/mailman/hacking' fake_testdir = self._make_fake(fake_cwd) - config_file = os.path.join(fake_testdir, 'mailman.cfg') + config_file = os.path.realpath( + os.path.join(fake_testdir, 'mailman.cfg')) with fakedirs(fake_testdir): # Write a mostly empty configuration file. with open(os.path.join(fake_testdir, 'mailman.cfg'), 'w') as fp: print >> fp, '# Fake mailman.cfg file' with chdir(fake_testdir): - # Split off any /private prefix imposed by Mac OS X. - found = search_for_configuration_file() - if found.startswith('/private'): - found = found[8:] + # sometimes symlinks bite us (eg. OS X /var -> /private/var) + found = os.path.realpath(search_for_configuration_file()) self.assertEqual(found, config_file) -- cgit v1.3.1