~ubuntu-branches/ubuntu/quantal/enigmail/quantal-security

« back to all changes in this revision

Viewing changes to mozilla/testing/mozbase/mozprofile/tests/bug758250.py

  • Committer: Package Import Robot
  • Author(s): Chris Coulson
  • Date: 2013-09-13 16:02:15 UTC
  • mfrom: (0.12.16)
  • Revision ID: package-import@ubuntu.com-20130913160215-u3g8nmwa0pdwagwc
Tags: 2:1.5.2-0ubuntu0.12.10.1
* New upstream release v1.5.2 for Thunderbird 24

* Build enigmail using a stripped down Thunderbird 17 build system, as it's
  now quite difficult to build the way we were doing previously, with the
  latest Firefox build system
* Add debian/patches/no_libxpcom.patch - Don't link against libxpcom, as it
  doesn't exist anymore (but exists in the build system)
* Add debian/patches/use_sdk.patch - Use the SDK version of xpt.py and
  friends
* Drop debian/patches/ipc-pipe_rename.diff (not needed anymore)
* Drop debian/patches/makefile_depth.diff (not needed anymore)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python
 
2
 
 
3
import mozprofile
 
4
import os
 
5
import shutil
 
6
import tempfile
 
7
import unittest
 
8
 
 
9
here = os.path.dirname(os.path.abspath(__file__))
 
10
 
 
11
class Bug758250(unittest.TestCase):
 
12
    """
 
13
    use of --profile in mozrunner just blows away addon sources:
 
14
    https://bugzilla.mozilla.org/show_bug.cgi?id=758250
 
15
    """
 
16
 
 
17
    def test_profile_addon_cleanup(self):
 
18
 
 
19
        # sanity check: the empty addon should be here
 
20
        empty = os.path.join(here, 'empty')
 
21
        self.assertTrue(os.path.exists(empty))
 
22
        self.assertTrue(os.path.isdir(empty))
 
23
        self.assertTrue(os.path.exists(os.path.join(empty, 'install.rdf')))
 
24
 
 
25
        # because we are testing data loss, let's make sure we make a copy
 
26
        tmpdir = tempfile.mktemp()
 
27
        shutil.copytree(empty, tmpdir)
 
28
        self.assertTrue(os.path.exists(os.path.join(tmpdir, 'install.rdf')))
 
29
 
 
30
        # make a starter profile
 
31
        profile = mozprofile.FirefoxProfile()
 
32
        path = profile.profile
 
33
 
 
34
        # make a new profile based on the old
 
35
        newprofile = mozprofile.FirefoxProfile(profile=path, addons=[tmpdir])
 
36
        newprofile.cleanup()
 
37
 
 
38
        # the source addon *should* still exist
 
39
        self.assertTrue(os.path.exists(tmpdir))
 
40
        self.assertTrue(os.path.exists(os.path.join(tmpdir, 'install.rdf')))
 
41
 
 
42
        # remove vestiges
 
43
        shutil.rmtree(tmpdir)
 
44
 
 
45
if __name__ == '__main__':
 
46
    unittest.main()