Add tests for courses, change study guide description

This commit is contained in:
Stijn De Clercq 2022-02-11 22:26:23 +01:00
parent c6958d22f3
commit 9819e82638
3 changed files with 37 additions and 2 deletions

View file

@ -3,6 +3,7 @@ from typing import Optional
import dacite
import json
from os import path
@dataclass
@ -16,7 +17,9 @@ class Course:
def load_courses() -> dict[str, Course]:
"""Create a list of all courses"""
with open("files/courses.json", "r") as file:
# Allows testing
filepath = path.join(path.dirname(__file__), "..", "files", "courses.json")
with open(filepath, "r") as file:
data = json.load(file)
courses = {}