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

Quelle  stubs.py   Sprache: Python

 
import os
import shutil
import tempfile

# stub file paths
files = [
    ("foo.txt",),
    (
        "foo",
        "bar.txt",
    ),
    (
        "foo",
        "bar",
        "fleem.txt",
    ),
    (
        "foobar",
        "fleem.txt",
    ),
    ("bar.txt",),
    (
        "nested_tree",
        "bar",
        "fleem.txt",
    ),
    ("readonly.txt",),
]


def create_empty_stub():
    tempdir = tempfile.mkdtemp()
    return tempdir


def create_stub(tempdir=None):
    """create a stub directory"""

    tempdir = tempdir or tempfile.mkdtemp()
    try:
        for path in files:
            fullpath = os.path.join(tempdir, *path)
            dirname = os.path.dirname(fullpath)
            if not os.path.exists(dirname):
                os.makedirs(dirname)
            contents = path[-1]
            f = open(fullpath, "w")
            f.write(contents)
            f.close()
        return tempdir
    except Exception:
        try:
            shutil.rmtree(tempdir)
        except Exception:
            pass
        raise

Messung V0.5
C=99 H=90 G=94

¤ Dauer der Verarbeitung: 0.13 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.