#!/usr/bin/env python3 # Copyright 2023 The ChromiumOS Authors # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Provides utilities to read and edit the ChromiumOS Manifest entries. While this code reads and edits the internal manifest, it should only operate on toolchain projects (llvm-project, etc.) which are public. """ import unittest from xml.etree import ElementTree import manifest_utils MANIFEST_FIXTURE = """ """ class TestManifestUtils(unittest.TestCase): """Test manifest_utils.""" def test_update_chromeos_manifest(self): root = ElementTree.fromstring( MANIFEST_FIXTURE, parser=manifest_utils.make_xmlparser(), ) manifest_utils.update_chromeos_manifest_tree("wxyz", root) string_root1 = ElementTree.tostring(root) self.assertRegex( str(string_root1, encoding="utf-8"), r'revision="wxyz"', ) self.assertRegex( str(string_root1, encoding="utf-8"), r"