From b855853ce57ea2bc40f464384ef04d25f87515b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Tarti=C3=A8re?= Date: Thu, 28 Mar 2024 16:56:26 -1000 Subject: [PATCH] Add test to ensure the date is properly formatted The format of the date is stricted than what is permitted by ISO 8601, so add a test with a basic pattern to make sure formatting is not broken again in the future. Signed-off-by: Carmen Bianca BAKKER --- tests/test_report.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/test_report.py b/tests/test_report.py index 7fa0f695..bf65ad64 100644 --- a/tests/test_report.py +++ b/tests/test_report.py @@ -8,6 +8,7 @@ import os +import re import sys from importlib import import_module from textwrap import dedent @@ -451,7 +452,11 @@ def test_bill_of_materials(fake_repository, multiprocessing): project = Project.from_directory(fake_repository) report = ProjectReport.generate(project, multiprocessing=multiprocessing) # TODO: Actually do something - report.bill_of_materials() + bom = report.bill_of_materials() + created_re = re.compile( + r"^Created: \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$", re.MULTILINE + ) + assert created_re.search(bom) is not None # REUSE-IgnoreEnd