# 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 os from argparse import Namespace from collections import defaultdict from textwrap import dedent
import mozunit import pytest from conftest import setup_args from manifestparser import TestManifest
def test_args_validation(get_active_tests, create_manifest): # Test args set in a single manifest.
manifest_relpath = "manifest.ini"
manifest = create_manifest(
dedent( """
[DEFAULT]
args=
--cheese
--foo=bar
--foo1 bar1
# Test args set with runByManifest disabled.
options["runByManifest"] = False with pytest.raises(SystemExit):
get_active_tests(**options)
# Test args set in non-default section.
options["runByManifest"] = True
options["manifestFile"] = create_manifest(
dedent( """
[files/test_pass.html]
args=--foo2=bar2
[files/test_fail.html] """
)
) with pytest.raises(SystemExit):
get_active_tests(**options)
def test_args_validation_with_ancestor_manifest(get_active_tests, create_manifest): # Test args set by an ancestor manifest.
create_manifest(
dedent( """
[DEFAULT]
args=
--cheese
def test_prefs_validation(get_active_tests, create_manifest): # Test prefs set in a single manifest.
manifest_relpath = "manifest.ini"
manifest = create_manifest(
dedent( """
[DEFAULT]
prefs=
foo=bar
browser.dom.foo=baz
# Test prefs set with runByManifest disabled.
options["runByManifest"] = False with pytest.raises(SystemExit):
get_active_tests(**options)
# Test prefs set in non-default section.
options["runByManifest"] = True
options["manifestFile"] = create_manifest(
dedent( """
[files/test_pass.html]
prefs=foo=bar
[files/test_fail.html] """
)
) with pytest.raises(SystemExit):
get_active_tests(**options)
def test_prefs_validation_with_ancestor_manifest(get_active_tests, create_manifest): # Test prefs set by an ancestor manifest.
create_manifest(
dedent( """
[DEFAULT]
prefs=
foo=bar
browser.dom.foo=baz
¤ 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.0.12Bemerkung:
(vorverarbeitet)
¤
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 ist noch experimentell.