mirror of
https://codeberg.org/fediverse/fep.git
synced 2026-08-05 11:46:04 +00:00
Validate date fields in front matter (#187)
Reviewed-on: https://codeberg.org/fediverse/fep/pulls/187
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import datetime
|
||||
import pytest
|
||||
import hashlib
|
||||
|
||||
@@ -21,6 +22,13 @@ def test_fep(fep):
|
||||
if parsed_frontmatter["status"] == "WITHDRAWN":
|
||||
assert "dateWithdrawn" in parsed_frontmatter
|
||||
|
||||
for field_name in ["dateReceived", "dateFinalized", "dateWithdrawn"]:
|
||||
if field_name in parsed_frontmatter:
|
||||
datetime.datetime.strptime(
|
||||
parsed_frontmatter[field_name],
|
||||
"%Y-%m-%d"
|
||||
)
|
||||
|
||||
assert "## Summary" in content
|
||||
assert "## Copyright" in content
|
||||
|
||||
|
||||
Reference in New Issue
Block a user