Skip to content

Commit

Permalink
NPI-3388 add notes on further unit tests we should have. Add clarific…
Browse files Browse the repository at this point in the history
…ation about why a test including gen_sp3_content() does not use a mock file for input.
  • Loading branch information
treefern committed Jan 14, 2025
1 parent e31466d commit 2c184c1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test_sp3.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,22 @@ def test_read_sp3_validation_sv_count_mismatch_header_vs_content(self, mock_file
# TODO Add test(s) for correctly reading header fundamentals (ACC, ORB_TYPE, etc.)
# TODO add tests for correctly reading the actual content of the SP3 in addition to the header.
# TODO add tests for correctly generating sp3 output content with gen_sp3_content() and gen_sp3_header()
# These tests should include:
# - Correct alignment of POS, CLK, STDPOS STDCLK, (not velocity yet), FLAGS
# - Correct alignment of the above when nodata and infinite values are present
# - Inclusion of HLM orbit_type in header, after applying Helmert trainsformation (if not covered elsewhere?
# Probably should be covered elsewhere)
# - Not including column names (can just test that output matches expected format)
# - Not including any NaN value *anywhere*

def test_gen_sp3_content_velocity_exception_handling(self):
"""
gen_sp3_content() velocity output should raise exception (currently unsupported).\
If asked to continue with warning, it should remove velocity columns before output.
"""
# Input data passed as bytes here, rather than using a mock file, because the mock file setup seems to break
# part of Pandas Styler, which is used by gen_sp3_content(). Specifically, some part of Styler's attempt to
# load style config files leads to a crash, despite some style config files appearing to read successfully)
input_data_fresh = input_data + b"" # Lazy attempt at not passing a reference
sp3_df = sp3.read_sp3(bytes(input_data_fresh), pOnly=False)
with self.assertRaises(NotImplementedError):
Expand Down

0 comments on commit 2c184c1

Please sign in to comment.