Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion definitions/EiffelTestCaseFinishedEvent/1.0.0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,8 @@ required:
- links
additionalProperties: false
_links: {}
_history: []
_history:
- version: 1.0.0
introduced_in: '[edition-bordeaux](../../../tree/edition-bordeaux)'
changes: Initial version.
_examples: []
Original file line number Diff line number Diff line change
Expand Up @@ -181,5 +181,8 @@ required:
- links
additionalProperties: false
_links: {}
_history: []
_history:
- version: 1.0.0
introduced_in: '[edition-bordeaux](../../../tree/edition-bordeaux)'
changes: Initial version.
_examples: []
35 changes: 35 additions & 0 deletions test_definitions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright 2023 Axis Communications AB.
# For a full list of individual contributors, please see the commit history.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import pathlib

import pytest

import definition_loader


@pytest.mark.parametrize(
"event_definition_path",
pathlib.Path(".").glob("definitions/Eiffel*Event/*.yml"),
)
def test_history_table_contains_current_version(event_definition_path):
definition = definition_loader.load(event_definition_path)
event_type = event_definition_path.parent.name
event_version = event_definition_path.stem
assert [
entry
for entry in definition.get("_history", [])
if entry.get("version") == event_version
], f"History table entry missing for {event_type} {event_version}"