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

Quelle  test_msix.py   Sprache: Python

 
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

import unittest

from mozunit import main

from mozbuild.repackaging.msix import get_embedded_version


class TestMSIX(unittest.TestCase):
    def test_embedded_version(self):
        """Test embedded version extraction."""

        buildid = "YYYY0M0D0HMmSs"
        for input, output in [
            ("X.0a1""X.YY0M.D0H.0"),
            ("X.YbZ""X.Y.Z.0"),
            ("X.Yesr""X.Y.0.0"),
            ("X.Y.Zesr""X.Y.Z.0"),
            ("X.YrcZ""X.Y.Z.0"),
            ("X.Y""X.Y.0.0"),
            ("X.Y.Z""X.Y.Z.0"),
        ]:
            version = get_embedded_version(input, buildid)
            self.assertEqual(version, output)
            # Some parts of the MSIX packaging ecosystem require the final digit
            # in the dotted quad to be 0.
            self.assertTrue(version.endswith(".0"))

        buildid = "YYYYMmDdHhMmSs"
        for input, output in [
            ("X.0a1""X.YYMm.DdHh.0"),
        ]:
            version = get_embedded_version(input, buildid)
            self.assertEqual(version, output)
            # Some parts of the MSIX packaging ecosystem require the final digit
            # in the dotted quad to be 0.
            self.assertTrue(version.endswith(".0"))

        for input in [
            "X.Ya1",
            "X.0a2",
            "X.Y.ZbW",
            "X.Y.ZrcW",
        ]:
            with self.assertRaises(ValueError):
                get_embedded_version(input, buildid)


if __name__ == "__main__":
    main()

Messung V0.5
C=92 H=96 G=93

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

*© 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.