summaryrefslogtreecommitdiffstats
path: root/testing/mozbase/mozprofile/tests/bug758250.py
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /testing/mozbase/mozprofile/tests/bug758250.py
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'testing/mozbase/mozprofile/tests/bug758250.py')
-rwxr-xr-xtesting/mozbase/mozprofile/tests/bug758250.py53
1 files changed, 53 insertions, 0 deletions
diff --git a/testing/mozbase/mozprofile/tests/bug758250.py b/testing/mozbase/mozprofile/tests/bug758250.py
new file mode 100755
index 000000000..f25901a19
--- /dev/null
+++ b/testing/mozbase/mozprofile/tests/bug758250.py
@@ -0,0 +1,53 @@
+#!/usr/bin/env python
+
+import mozprofile
+import os
+import shutil
+import tempfile
+import unittest
+
+
+here = os.path.dirname(os.path.abspath(__file__))
+
+
+class Bug758250(unittest.TestCase):
+ """
+ use of --profile in mozrunner just blows away addon sources:
+ https://bugzilla.mozilla.org/show_bug.cgi?id=758250
+ """
+
+ def setUp(self):
+ self.tmpdir = tempfile.mkdtemp()
+ self.addon = os.path.join(here, 'addons', 'empty')
+
+ def tearDown(self):
+ # remove vestiges
+ shutil.rmtree(self.tmpdir)
+
+ def test_profile_addon_cleanup(self):
+
+ # sanity check: the empty addon should be here
+ self.assertTrue(os.path.exists(self.addon))
+ self.assertTrue(os.path.isdir(self.addon))
+ self.assertTrue(os.path.exists(os.path.join(self.addon, 'install.rdf')))
+
+ # because we are testing data loss, let's make sure we make a copy
+ shutil.rmtree(self.tmpdir)
+ shutil.copytree(self.addon, self.tmpdir)
+ self.assertTrue(os.path.exists(os.path.join(self.tmpdir, 'install.rdf')))
+
+ # make a starter profile
+ profile = mozprofile.FirefoxProfile()
+ path = profile.profile
+
+ # make a new profile based on the old
+ newprofile = mozprofile.FirefoxProfile(profile=path, addons=[self.tmpdir])
+ newprofile.cleanup()
+
+ # the source addon *should* still exist
+ self.assertTrue(os.path.exists(self.tmpdir))
+ self.assertTrue(os.path.exists(os.path.join(self.tmpdir, 'install.rdf')))
+
+
+if __name__ == '__main__':
+ unittest.main()