Mercurial > mozilla > hg > ProfileManager
diff profilemanager/tests/test.py @ 34:5a27ad649768
more verbose asserts
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Thu, 06 May 2010 17:44:54 -0700 |
parents | 6f2ad307fdda |
children | b9d7f5f61e23 |
line wrap: on
line diff
--- a/profilemanager/tests/test.py Thu May 06 17:37:30 2010 -0700 +++ b/profilemanager/tests/test.py Thu May 06 17:44:54 2010 -0700 @@ -9,8 +9,8 @@ path = os.path.join(profiles_dir, 'profiles.ini') profiles = resource_filename('profilemanager', path) profiles_dir = resource_filename('profilemanager', profiles_dir) -assert os.path.exists(profiles) -assert os.path.exists(profiles_dir) +assert os.path.exists(profiles), '%s does not exist' % profiles +assert os.path.exists(profiles_dir), '%s does not exist' % profiles_dir # Instatiate a ProfileManager: manager = ProfileManager(profiles) @@ -19,12 +19,12 @@ profiles_dict = manager.profiles_dict() for profile in profiles_dict: manager.remove(profile) -assert os.listdir(profiles_dir) == ['profiles.ini'] -assert file(profiles).read().strip() == '[General]' +assert os.listdir(profiles_dir) == ['profiles.ini'], 'profiles_dir isnt empty except profiles.ini' +assert file(profiles).read().strip() == '[General]', 'profiles.ini isnt nearly empty' # Create a new profile: profiledir = manager.new('testprofile') -assert profiledir.endswith('.testprofile') +assert profiledir.endswith('.testprofile'), 'profiledir should end with testprofile, instead it is %s' % profiledir) # Cleanup: manager.remove('testprofile')