Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/C/Firefox/testing/mozbase/mozprofile/tests/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 1 kB image not shown  

Quelle  test_bug758250.py   Sprache: Python

 
#!/usr/bin/env python

import os
import shutil

import mozprofile
import mozunit

here = os.path.dirname(os.path.abspath(__file__))

"""
use of --profile in mozrunner just blows away addon sources:
https://bugzilla.mozilla.org/show_bug.cgi?id=758250
"""


def test_profile_addon_cleanup(tmpdir):
    tmpdir = tmpdir.mkdtemp().strpath
    addon = os.path.join(here, "addons""empty")

    # sanity check: the empty addon should be here
    assert os.path.exists(addon)
    assert os.path.isdir(addon)
    assert os.path.exists(os.path.join(addon, "install.rdf"))

    # because we are testing data loss, let's make sure we make a copy
    shutil.rmtree(tmpdir)
    shutil.copytree(addon, tmpdir)
    assert os.path.exists(os.path.join(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=[tmpdir])
    newprofile.cleanup()

    # the source addon *should* still exist
    assert os.path.exists(tmpdir)
    assert os.path.exists(os.path.join(tmpdir, "install.rdf"))


if __name__ == "__main__":
    mozunit.main()

Messung V0.5
C=94 H=96 G=94

¤ Dauer der Verarbeitung: 0.11 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.