Skip to content

Commit 8209a17

Browse files
committed
work
1 parent f8aae7f commit 8209a17

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/test_fix_date.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
import os
2+
import sys
23
import tempfile
34
import frontmatter
45
import pytest
56

7+
8+
# Add the project root to sys.path
9+
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
10+
611
import fix_date
712

813

@@ -12,7 +17,8 @@ def test_extract_date_from_filename():
1217

1318

1419
def create_markdown_file(path, front_matter):
15-
content = frontmatter.dumps(front_matter) + "\nBody"
20+
post = frontmatter.Post(content="Body", **front_matter)
21+
content = frontmatter.dumps(post)
1622
with open(path, 'w', encoding='utf-8') as f:
1723
f.write(content)
1824

0 commit comments

Comments
 (0)