Skip to content

Commit

Permalink
added mock unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
picciama committed Nov 10, 2023
1 parent d27eddc commit ec7df40
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/unit_tests/test_sage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import unittest
from pathlib import Path

import pandas as pd
from spectrum_fundamentals.search_result import Sage


class TestSage(unittest.TestCase):
"""Test vlass to check Sage search result processing."""

def test_read_sage(self):
"""Test function for reading sage results and transforming to Prosit format."""
sage_output_path = Path(__file__.parent / "data" / "sage_output.tsv")
expected_sage_internal_path = Path(__file__.parent / "data" / "sage_output_internal.csv")

internal_search_results_df = Sage.read_result(sage_output_path)

# execute only once, then remove and test again
internal_search_results_df.to_csv(expected_sage_internal_path)

self.assertEqual(internal_search_results_df, pd.read_csv(expected_sage_internal_path))

0 comments on commit ec7df40

Please sign in to comment.