Skip to content

Commit

Permalink
Merge pull request #83 from UBC-MDS/test-path-fix
Browse files Browse the repository at this point in the history
Fix: locating test folder path bug
  • Loading branch information
michael-gelfand authored Feb 2, 2025
2 parents 0269b3f + 49755cd commit 49e67ca
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/test_internals.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import pytest
import pandas as pd
from worldfinder._internals import load_data
import os
from pathlib import Path


def test_load_data_functionality():
Expand All @@ -13,7 +15,12 @@ def test_load_data_functionality():
[7, 8, 9]],
columns=['x', 'y', 'z']
)
result = load_data("../../tests", "dummy_csv.csv")

repo_root = Path(__file__).resolve().parent.parent # obtain absolute path to root of repo
test_data_path = repo_root / "tests" # Append path to the test folder
dir_path = str(test_data_path)

result = load_data(dir_path, "dummy_csv.csv")
pd.testing.assert_frame_equal(result, expected_df)


Expand Down

0 comments on commit 49e67ca

Please sign in to comment.