From 181b44b28ea51429e270eb2c7a0cac20a871f214 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Fri, 9 Jun 2023 14:13:22 -0700 Subject: [PATCH] car docs: test print_docs_diff (#28459) * test print docs * delete * remove this * print --- selfdrive/car/tests/test_docs.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/selfdrive/car/tests/test_docs.py b/selfdrive/car/tests/test_docs.py index f42c094856..7ea9f6c9fe 100755 --- a/selfdrive/car/tests/test_docs.py +++ b/selfdrive/car/tests/test_docs.py @@ -1,12 +1,16 @@ #!/usr/bin/env python3 from collections import defaultdict +import os import re import unittest +from common.basedir import BASEDIR from selfdrive.car.car_helpers import interfaces, get_interface_attr from selfdrive.car.docs import CARS_MD_OUT, CARS_MD_TEMPLATE, generate_cars_md, get_all_car_info from selfdrive.car.docs_definitions import Cable, Column, PartType, Star from selfdrive.car.honda.values import CAR as HONDA +from selfdrive.debug.dump_car_info import dump_car_info +from selfdrive.debug.print_docs_diff import print_car_info_diff class TestCarDocs(unittest.TestCase): @@ -22,6 +26,12 @@ class TestCarDocs(unittest.TestCase): self.assertEqual(generated_cars_md, current_cars_md, "Run selfdrive/car/docs.py to update the compatibility documentation") + def test_docs_diff(self): + dump_path = os.path.join(BASEDIR, "selfdrive", "car", "tests", "cars_dump") + dump_car_info(dump_path) + print_car_info_diff(dump_path) + os.remove(dump_path) + def test_duplicate_years(self): make_model_years = defaultdict(list) for car in self.all_cars: