| # Copyright 2024 The Fuchsia Authors. All rights reserved. | |
| # Use of this source code is governed by a BSD-style license that can be | |
| # found in the LICENSE file. | |
| # Generated by //build/rust/tests/create_rustdoc_tests.py | |
| # Test explanation: test the fact that our test runner will document this crate somewhere else | |
| import unittest # noqa | |
| from sys import argv | |
| from unittest import TestCase | |
| from zipfile import Path | |
| _doc_zip = argv.pop() | |
| class Test(TestCase): | |
| _path: Path | |
| @classmethod | |
| def setUpClass(cls) -> None: | |
| cls._path = Path(_doc_zip) | |
| def testFileExists0(self) -> None: | |
| self.assertTrue( | |
| (self._path / "echo/enum.Echo.html").is_file(), | |
| msg=f"expected `echo/enum.Echo.html` to be a file in {repr(self._path)}", | |
| ) | |
| def testFileExists1(self) -> None: | |
| self.assertFalse( | |
| (self._path / "foxtrot/trait.Foxtrot.html").is_file(), | |
| msg=f"expected `foxtrot/trait.Foxtrot.html` to not be a file in {repr(self._path)}", | |
| ) | |
| def testFileContainsRaw2(self) -> None: | |
| found = (self._path / "echo/enum.Echo.html").read_text() | |
| self.assertIn( | |
| "Foxtrot", | |
| found, | |
| ) |