lint / go (push) Canceled after 0s
lint / go_mod (push) Canceled after 0s
lint / conf (push) Canceled after 0s
lint / docslinks (push) Canceled after 0s
lint / docsorder (push) Canceled after 0s
lint / apidocs (push) Canceled after 0s
lint / other (push) Canceled after 0s
test / test_64 (push) Canceled after 0s
test / test_32 (push) Canceled after 0s
test / test_e2e (push) Canceled after 0s
37 lines
1.1 KiB
Python
37 lines
1.1 KiB
Python
from __future__ import annotations
|
|
|
|
import json
|
|
import sys
|
|
import unittest
|
|
from pathlib import Path
|
|
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
sys.path.insert(0, str(ROOT / "dev_scripts"))
|
|
|
|
import harness # noqa: E402
|
|
from wiki_docs import load_config # noqa: E402
|
|
|
|
|
|
class HarnessTest(unittest.TestCase):
|
|
def test_non_strict_structure(self) -> None:
|
|
self.assertEqual([], harness.check(False))
|
|
|
|
def test_mapping_paths_are_isolated(self) -> None:
|
|
config = load_config(ROOT / "wiki-docs.json")
|
|
self.assertTrue(config.mappings)
|
|
self.assertTrue(all(item.path.startswith("docs/maintainer/") for item in config.mappings))
|
|
|
|
def test_target_repository(self) -> None:
|
|
raw = json.loads((ROOT / "wiki-docs.json").read_text(encoding="utf-8"))
|
|
self.assertEqual("OPC", raw["owner"])
|
|
self.assertEqual("mediamtx", raw["repository"])
|
|
|
|
def test_sensitive_camera_file_is_ignored(self) -> None:
|
|
ignored = (ROOT / ".gitignore").read_text(encoding="utf-8")
|
|
self.assertIn("/ip_camera.env", ignored)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|