Skip to content

Commit 8620f42

Browse files
committed
Added test for the initialize_data function
1 parent e0d6092 commit 8620f42

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

tests/conftest.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import sys
2+
import os
3+
4+
# Add the src/ directory to the pythonpath
5+
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'src')))

tests/test_initialization.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
"""Tests for the initialization of the data."""
2+
3+
import pandas as pd
4+
import pytest
5+
6+
from initialization import initialize_data
7+
8+
9+
def test_initialize_data():
10+
"""Test that initialize_data works without an error."""
11+
input_dir = 'grassland'
12+
runtime = pd.read_csv(input_dir+'/runtime.txt', header=None, index_col=0, sep='\t')
13+
data = initialize_data(runtime, input_dir)
14+
assert isinstance(data, dict)

0 commit comments

Comments
 (0)