9
here = os.path.dirname(os.path.abspath(__file__))
11
class Bug758250(unittest.TestCase):
13
use of --profile in mozrunner just blows away addon sources:
14
https://bugzilla.mozilla.org/show_bug.cgi?id=758250
17
def test_profile_addon_cleanup(self):
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')))
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')))
30
# make a starter profile
31
profile = mozprofile.FirefoxProfile()
32
path = profile.profile
34
# make a new profile based on the old
35
newprofile = mozprofile.FirefoxProfile(profile=path, addons=[tmpdir])
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')))
45
if __name__ == '__main__':