1
0
Fork 0
mirror of https://github.com/Findus23/new-github-changelog-generator.git synced 2024-08-27 19:52:18 +02:00
new-github-changelog-generator/tests/test_fixtures.py
2019-02-14 13:03:32 +01:00

21 lines
478 B
Python

import json
from datetime import datetime
import pytest
from generator import Issue
def load_json(path):
with open(path) as file:
return json.load(file)
@pytest.fixture
def issues(request):
issues = []
for i in load_json(request.fspath.join('../api_responses/').join("issues.json")):
issue = Issue(i)
issue.compare_close_date(datetime.strptime("2019-01-25 00:00:00", "%Y-%m-%d %H:%M:%S"))
issues.append(issue)
return issues