# 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 sys import types from pathlib import Path from unittest.mock import patch
from mozunit import main
from mach.base import MachError from mach.test.conftest import TestBase
class Entry: """Stub replacement for pkg_resources.EntryPoint"""
@patch("pkg_resources.iter_entry_points") def test_load_entry_point_from_directory(self, mock): # Ensure parent module is present otherwise we'll (likely) get # an error due to unknown parent. if"mach.commands"notin sys.modules:
mod = types.ModuleType("mach.commands")
sys.modules["mach.commands"] = mod
mock.return_value = [Entry([self.provider_dir])] # Mach error raised due to conditions_invalid.py with self.assertRaises(MachError):
self._run_help()
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.